Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redact URLs in automatic Rails breadcrumbs #806

Merged
merged 1 commit into from
Dec 18, 2023

Conversation

imjoehaines
Copy link
Contributor

No description provided.

@imjoehaines imjoehaines merged commit 3df6c85 into next Dec 18, 2023
133 checks passed
@imjoehaines imjoehaines deleted the redact-rails-breadcrumbs branch December 18, 2023 10:32
@imjoehaines imjoehaines mentioned this pull request Jan 8, 2024
filtered_data[:path] = Bugsnag.cleaner.clean_url(data[:path]) if data.key?(:path)

when "redirect_to.action_controller"
filtered_data[:location] = Bugsnag.cleaner.clean_url(data[:location]) if data.key?(:location)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This causes an error to surface in the app if the data[:location] (ie. the redirect_to url) is a badly formed, but actually in practice working URL, such as: https://example.com/some path with spaces -- browsers (and even rack:test) will automatically convert this to https://example.com/some path%20with%20spaces but URI("https://example.com/some path with spaces") (as used at https://github.com/bugsnag/bugsnag-ruby/blob/master/lib/bugsnag/cleaner.rb#L30) will raise URI::InvalidURIError

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @timdiggins! I'll try to get a release out with a fix early next week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants