Skip to content
This repository has been archived by the owner on May 16, 2021. It is now read-only.

Commit

Permalink
Add parens for 'Ambiguous first argument' warnings in jruby
Browse files Browse the repository at this point in the history
  • Loading branch information
dekellum committed Sep 29, 2011
1 parent fff0570 commit 37b7b73
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/rack/protection/ip_spoofing.rb
Expand Up @@ -13,7 +13,7 @@ class IPSpoofing < Base

def accepts?(env)
return true unless env.include? 'HTTP_X_FORWARDED_FOR'
ips = env['HTTP_X_FORWARDED_FOR'].split /\s*,\s*/
ips = env['HTTP_X_FORWARDED_FOR'].split(/\s*,\s*/)
return false if env.include? 'HTTP_CLIENT_IP' and not ips.include? env['HTTP_CLIENT_IP']
return false if env.include? 'HTTP_X_REAL_IP' and not ips.include? env['HTTP_X_REAL_IP']
true
Expand Down
2 changes: 1 addition & 1 deletion lib/rack/protection/path_traversal.rb
Expand Up @@ -22,7 +22,7 @@ def cleanup(path)
return cleanup("/" << path)[1..-1] unless path[0] == ?/
escaped = ::File.expand_path path.gsub('%2e', '.').gsub('%2f', '/')
escaped << '/' if escaped[-1] != ?/ and path =~ /\/\.{0,2}$/
escaped.gsub /\/\/+/, '/'
escaped.gsub(/\/\/+/, '/')
end
end
end
Expand Down

0 comments on commit 37b7b73

Please sign in to comment.