airbrake/airbrake — Issue #61: Rack exceptions do not consider ignored user agents
Author: kmcbride
Created: 2012-02-25 02:26:16+00:00
State: open

As the title suggests, exceptions rescued within the Rack middleware do not take the config.ignore_user_agent into account.

I'm currently working around this through the following (ugly) initializer patch, but hopefully a cleaner solution will make its way into an upcoming release.

```ruby
module Airbrake
class Notice
alias :airbrake_ignore? :ignore?

def ignore?
user_agent = args[:rack_env] ? args[:rack_env]['HTTP_USER_AGENT'] : nil
ignore_user_agent = Airbrake.configuration.ignore_user_agent.flatten.any? { |ua| ua === user_agent }

ignore_user_agent || airbrake_ignore?
end
end
end
```