Skip to content

Commit

Permalink
Unimplented methods removed
Browse files Browse the repository at this point in the history
  • Loading branch information
pka committed Jan 10, 2010
1 parent d0ac829 commit 4018bce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ interface:
* Rack::AcceptFormat - Adds a format extension at the end of the URI when there is none, corresponding to the mime-type given in the Accept HTTP header.
* Rack::HostMeta - Configures /host-meta using a block
* Rack::Cookies - Adds simple cookie jar hash to env
* Rack::Access - Limit access based on IP address, password cookie or a token
* Rack::Access - Limit access based on IP address

=== Use

Expand Down
9 changes: 2 additions & 7 deletions lib/rack/contrib/access.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
module Rack

##
# Rack middleware for limiting access based on IP address, password cookie or a token
# Rack middleware for limiting access based on IP address
#
#
# === Options:
#
# :allow_ipmasks Array of remote addresses which are allowed to access
# :password
# :secret_key
#
# === Examples:
#
Expand All @@ -25,9 +23,7 @@ class Access
def initialize(app, options = {})
@app = app
@options = {
:allow_ipmasks => ["127.0.0.1"],
:password => nil,
:secret_key => nil
:allow_ipmasks => ["127.0.0.1"]
}.merge(options)
@options[:allow_ipmasks].collect! do |ipmask|
ipmask.is_a?(IPAddr) ? ipmask : IPAddr.new(ipmask)
Expand All @@ -53,6 +49,5 @@ def ip_authorized?
end
end


end
end

0 comments on commit 4018bce

Please sign in to comment.