mirror of
https://github.com/samsonjs/rack-attack.git
synced 2026-04-27 15:07:41 +00:00
Merge pull request #152 from ktheory/readme-ipv6-localhost
README: add ipv6 example
This commit is contained in:
commit
6789b28c7b
1 changed files with 1 additions and 1 deletions
|
|
@ -104,7 +104,7 @@ A [Rack::Request](http://www.rubydoc.info/gems/rack/Rack/Request) object is pass
|
||||||
# (blacklist & throttles are skipped)
|
# (blacklist & throttles are skipped)
|
||||||
Rack::Attack.whitelist('allow from localhost') do |req|
|
Rack::Attack.whitelist('allow from localhost') do |req|
|
||||||
# Requests are allowed if the return value is truthy
|
# Requests are allowed if the return value is truthy
|
||||||
'127.0.0.1' == req.ip
|
'127.0.0.1' == req.ip || '::1' == req.ip
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue