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

improper URL-decoding in AWS.Client #383

Open
Rombobeorn opened this issue Sep 23, 2024 · 0 comments
Open

improper URL-decoding in AWS.Client #383

Rombobeorn opened this issue Sep 23, 2024 · 0 comments

Comments

@Rombobeorn
Copy link

When a properly percent-encoded URL is passed to AWS.Client.Get, the path and the query are decoded before the request is sent to the server. This can result in an invalid request and a 400 response. Any bytes that aren't allowed in a URL must be percent-encoded in the HTTP request. To send a valid request I have to escape the percent signs with a second round of percent-encoding before I pass the URL to Get, which is quite wrong.

It would make more sense for AWS.Client to do the opposite – to percent-encode instead of decoding. It would then accept an IRI in a known character encoding and convert it into a URL before sending, using the method specified in RFC 3987.

As long as AWS.Client doesn't handle IRIs, conversion from IRI to URL falls to the program using it. That conversion involves percent-encoding, and it's wrong for AWS.Client to undo it.

If it is necessary to decode percent-encoding while parsing the URL, then the path and query must be re-encoded before they're incorporated in the request. Such a roundtrip must be programmed with great care to avoid mangling the URL like in bug 382, so it's better to avoid the roundtrip.

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

No branches or pull requests

1 participant