Permalink
Browse files

Merge pull request #4 from dekellum/jruby-warning-fixes

Add parens for 'Ambiguous first argument' warnings in jruby
  • Loading branch information...
rkh committed Sep 29, 2011
2 parents fff0570 + 37b7b73 commit d864b539d95756bc90e31f306daa343aee23a28d
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/rack/protection/ip_spoofing.rb
  2. +1 −1 lib/rack/protection/path_traversal.rb
@@ -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
@@ -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

0 comments on commit d864b53

Please sign in to comment.