Skip to content

CloudFrontUtilities is not including the original query params correctly when signing resource url #3655

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

Closed
lx223 opened this issue Dec 22, 2022 · 5 comments
Labels
bug This issue is a bug.

Comments

@lx223
Copy link

lx223 commented Dec 22, 2022

Describe the bug

When using the new CloudFrontUtilities class to sign resource urls, the query params of the original urls are dropped and & is incorrectly appended.

Expected Behavior

Original query params should be kept like in v1 and & should be appended correctly.

e.g. https://google.com?a=b -> https://google.com?a=b&...

Current Behavior

signing https://google.com?a=b would give <host>&...

Reproduction Steps

Try include a url with query param in tests.

Possible Solution

Fix these lines:

String encodedPath = uri.getPath()
+ (request.resourceUrl().indexOf('?') >= 0 ? "&" : "?")

Additional Information/Context

No response

AWS Java SDK version used

2.18.33

JDK version used

11

Operating System and version

win 11

@lx223 lx223 added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 22, 2022
@mikand13
Copy link

mikand13 commented Jan 2, 2023

Can confirm that this is an issue.

@satamas
Copy link

satamas commented Jan 9, 2023

It happens because uri.getPath() is used here. I suppose that it should be replaced with request.resourceUrl()

@debora-ito debora-ito added needs-review This issue or PR needs review from the team. and removed needs-triage This issue or PR still needs to be triaged. needs-review This issue or PR needs review from the team. labels Jan 9, 2023
@debora-ito
Copy link
Member

Thank you everyone for reaching out, we'll work on a fix.

@debora-ito
Copy link
Member

The fix is available in SDK version 2.19.14. Please let try it out and let us know of any other problem.

@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

aws-sdk-java-automation added a commit that referenced this issue Feb 12, 2025
…69c2aeef0

Pull request: release <- staging/9875d744-8bf5-4cf2-8323-c1c69c2aeef0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

No branches or pull requests

4 participants