add debug to see what request contains

This commit is contained in:
carlad 2016-03-31 15:51:44 +02:00
parent d1848ba6f9
commit 49a6bb5d26

View File

@ -58,8 +58,11 @@ class Rack::Attack
#### ####
# Ban based on: IP address or access token # Ban based on: IP address or access token
# Ban time: 1 hour # Ban time: 1 hour
# Ban after: 10 POST requests within 30 seconds # Ban after: 10 POST requests within 30 seconds, unless api_builds_rate_limit is set in repository settings
blacklist('spamming with POST requests') do |request| blacklist('spamming with POST requests') do |request|
p "request.inspect ++++++++++++++++++++++++++++"
p request.inspect
p "+++++++++++++++++++++++++++++++++++++++++++++++++++"
Rack::Attack::Allow2Ban.filter(request.identifier, maxretry: 10, findtime: 30.seconds, bantime: bantime(1.hour)) do Rack::Attack::Allow2Ban.filter(request.identifier, maxretry: 10, findtime: 30.seconds, bantime: bantime(1.hour)) do
request.post? and not POST_WHITELISTED.include? request.path request.post? and not POST_WHITELISTED.include? request.path
end end