Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Filter params on Rails 3.1 when calling notify_airbrake #59
We recently noticed that Airbrake doesn't always filter our parameters.
I looked into the cases, and eventually narrowed it down to this: an unhandled exception is filtered properly, but a notification made via
I traced the problem to
def airbrake_filter_if_filtering(hash) return hash if ! hash.is_a?(Hash) if respond_to?(:filter_parameters) filter_parameters(hash) rescue hash else hash end end
After doing some research, I found that
I attempted to add a test for my changes, but couldn't reproduce the problem using the available helpers in
At any rate, the changes in this pull request fixes the problem when I tested on a staging environment. Our app is using Ruby 1.9.2p180 and Rails 3.1.2 at the time of this writing.
added a commit
this pull request
Feb 27, 2012
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
This bug was happening for us, too, and the parameters that were not getting filtered out were highly sensitive. In fact, the reason apps would filter parameters in the first place is because they are sensitive. We noticed that no gem update has been made since this issue was fixed. We highly recommend pushing a new version of the gem to rubygems before this causes some big problems for someone. In other words, this seems like a critical issue to push out an update for immediately.