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

test(client-s3): add path encoding test #4574

Merged
merged 1 commit into from
Mar 27, 2023

Conversation

milesziemer
Copy link
Contributor

Issue

Followup to #4523

Description

The S3 client uses a configuration option, signingEscapePath, set to false by default, to tell the signer not to encode the URL path. The serializer will encode these paths, so if the signer did as well, the paths would be encoded multiple times. S3 is the only client that uses this config option, and there were no tests that verified paths are encoded.

Testing

To verify it fails properly:

  • Added request.path = decodeURIComponent(request.path); to signature-v4/prepareRequest.ts, to make the path unencoded before it reaches the request handler.
  • Added .skip to signature-v4/SignatureV4.spec.ts, just so the signature-v4 tests don't fail, since we're trying to run client-s3 tests.
  • Ran yarn build in signature-v4
  • Ran yarn test:ci from SDK root
  • Verified the new client-s3 test failed

Additional context

yarn test:ci will only run this test when a dependency of client-s3 has been changed, and built.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

The S3 client uses a configuration option, `signingEscapePath`, set
to false by default, to tell the signer not to encode the URL path.
The serializer will encode these paths, so if the signer did as well,
the paths would be encoded multiple times. S3 is the only client that
uses this config option, and there were no tests that verified paths
are encoded.

This is a followup to aws#4523.
@milesziemer milesziemer requested a review from a team as a code owner March 24, 2023 17:21
@kuhe kuhe merged commit b5b6bee into aws:main Mar 27, 2023
@kuhe kuhe changed the title feat(client-s3): add path encoding test test(client-s3): add path encoding test Mar 27, 2023
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants