Skip to content

improper URL-decoding in AWS.Client #383

@Rombobeorn

Description

@Rombobeorn

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions