Permalink
Browse files

Validating nil user agents

  • Loading branch information...
1 parent 394789e commit d53e525d8758c5935b2c81c9dfbcafcccf6ff743 Elad Meidar committed Apr 24, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/rack/contrib/deflect.rb
@@ -59,7 +59,8 @@ def initialize app, options = {}
end
def call env
- if options[:ignore_agents].any? {|word| env["HTTP_USER_AGENT"].downcase.include?(word) }
+ if options[:ignore_agents].any? {|word| env["HTTP_USER_AGENT"].to_s.downcase.include?(word) }
+ rails_logger "Skipping user agent #{env["HTTP_USER_AGENT"]}"
status, headers, body = @app.call env
[status, headers, body]
else

0 comments on commit d53e525

Please sign in to comment.