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

Fix HTTP.rb non-ascii URI parsing #1369

Closed
wants to merge 1 commit into from

Conversation

stephannv
Copy link
Contributor

When Appsignal is enabled, it hooks into HTTP request method. It uses URI.parse when uri is a string, but URI.parse doesn't support non-ascii characters:

HTTP.get("http://www.example.com/áéíóúãÔù") # it works when appsignal is disabled

With Appsignal enabled, the code above raises this error:

URI::InvalidURIError:
       URI must be ascii only "http://www.example.com/\u00E1\u00E9\u00ED\u00F3\u00FA\u00E3\u00D4\u00F9"

The solution I found was using Addressable::URI.parse since it handles non-ascii characters.

ps.: Addressable is a HTTP's runtime dependency since 2015

@unflxw unflxw requested review from tombruijn and unflxw January 22, 2025 06:28
@unflxw unflxw self-assigned this Jan 22, 2025
@unflxw unflxw removed the request for review from tombruijn January 22, 2025 07:08
@unflxw
Copy link
Contributor

unflxw commented Jan 22, 2025

Thanks for fixing this issue @stephannv! I've made some minor tweaks to it in #1370 -- continuing there.

@unflxw unflxw closed this Jan 22, 2025
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.

2 participants