Skip to content

Commit

Permalink
Catch RackRequest crash while cleaning a URL
Browse files Browse the repository at this point in the history
  • Loading branch information
perldork authored and kattrali committed Apr 4, 2016
1 parent a31fb31 commit 5cfae87
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/bugsnag/middleware/rack_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ def call(notification)
# Build the clean url (hide the port if it is obvious)
url = "#{request.scheme}://#{request.host}"
url << ":#{request.port}" unless [80, 443].include?(request.port)
url << Bugsnag::Cleaner.new(notification.configuration.params_filters).clean_url(request.fullpath)

# If app is passed a bad URL, this code will crash attempting to clean it
begin
url << Bugsnag::Cleaner.new(notification.configuration.params_filters).clean_url(request.fullpath)
rescue StandardError => stde
Bugsnag.log "RackRequest - Rescued error while cleaning request.fullpath: #{stde}"
end

headers = {}

Expand Down

0 comments on commit 5cfae87

Please sign in to comment.