bugsnag / bugsnag-ruby

BugSnag error monitoring & reporting software for rails, sinatra, rack and ruby
https://docs.bugsnag.com/platforms/ruby
MIT License
246 stars 174 forks source link

Fix `Cleaner#clean_url` with mailto links #813

Closed imjoehaines closed 6 months ago

imjoehaines commented 6 months ago

Goal

mailto links don't have a query property, instead they use headers, e.g.:

uri = URI('mailto:hello@example.com?subject=hi')
uri.headers #=> [['subject', 'hi']]

The current Cleaner#clean_url fails on mailto links and wouldn't filter the headers if it did succeed. This PR updates it to handle filtering the headers in mailto links