Skip to content

Prevent unquoting of query string reserved characters - #60

Merged
tedder merged 1 commit into
tedder:masterfrom
mliarakos:query-string-quoting
Mar 24, 2022
Merged

tedder merged 1 commit into
tedder:masterfrom
mliarakos:query-string-quoting

Conversation

@mliarakos

@mliarakos mliarakos commented Jan 2, 2022 •

Copy link
Copy Markdown
Contributor

Fixes #59.

In amz_cano_querystring:

  • removed the initial unquote/quote steps to prevent the introduction of quoted reservered characters
  • manually quote semicolons so they aren't interpreted as an alternative delimiter to ampersand by parse_qs (AWS doesn't consider them a delimiter and this was previously handled by the quote step)

This breaks the post-vanilla-query-nonunreserved test in aws_testsuite because responses auto-quotes the URL, so in test_requests_aws4auth.py:

  • undo the URL auto-quoting so that the aws_testsuite URLs are passed in without modification (previously the unquote/quote steps temporarily undid the quoting)

Added test cases to cover this issue. All tests pass. including the live tests (for the endpoints that still exist).

@tedder

tedder commented Mar 24, 2022

Copy link
Copy Markdown
Owner

sorry for the delay. this is good!

@tedder
tedder merged commit 30df596 into tedder:master Mar 24, 2022
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.

Quoted reserved characters are unquoted when creating canonical query string

2 participants