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

AWS S3 Plus ('+') sign in path #1946

Closed
bade7n opened this issue Mar 20, 2019 · 6 comments
Closed

AWS S3 Plus ('+') sign in path #1946

bade7n opened this issue Mar 20, 2019 · 6 comments
Labels
guidance Question that needs advice or information.

Comments

@bade7n
Copy link

bade7n commented Mar 20, 2019

I am using user's token to access S3, java sdk version 1.11.521 and reproducible on 1.11.465.

I need to list bucket and read each entry later.

For example object url is https://s3.amazonaws.com/something-dev/dev_files/2017%2B000.zip
While listing something-dev/dev_files everything works fine and I receive object key as
dev_files/2017+000.zip
But

client.getObject(new GetObjectRequest("something-dev", "dev_files/2017+000.zip", null)) 

I got
The request signature we calculated does not match the signature you provided. Check your key and signing method.
Once I encode path to become dev_files/2017%2B000.zip or dev_files/2017%20000.zip or dev_files/2017 000.zip I got The specified key does not exist. (Service: Amazon S3; Status Code: 404.

  • I am allowed to use Plus(+) sign as part of file name at all? Because I can't read file in either way and the only solution that comes to my mind is to rename it.
  • And if someone managed to read that kind of files - how this sign should be encoded?

Am I missing something?

@debora-ito
Copy link
Member

@VladimirIL what version of httpclient are you using?

The SDK should url-encode automatically the param values, you don't have to do any extra encoding.

@debora-ito debora-ito added guidance Question that needs advice or information. response-requested Waiting on additional info or feedback. Will move to "closing-soon" in 5 days. labels Mar 20, 2019
@bade7n
Copy link
Author

bade7n commented Mar 21, 2019

Spring boot 2.1.3.RELEASE, aws-sdk 1.11.521, httpclient 4.5.7

@debora-ito
Copy link
Member

Could you please try running with httpclient 4.5.5 and see if you still have the same issue?

I reproduced your issue with httpclient 4.5.7, my guess is they introduced some changes in url encoding, we are still figuring out. With httpclient 4.5.5 I don't see the error.

@bade7n
Copy link
Author

bade7n commented Mar 22, 2019

It works, 4.5.6 works as well. Thanks for a hint.

@debora-ito
Copy link
Member

Yes, S3 keys with consecutive slashes // were also impacted by 4.5.7, as reported in #1919.

I'm closing this since we resolved your issue, and you can keep track of the 4.5.7 impact on the other thread. Feel free to reopen if you have any other question.

@debora-ito debora-ito removed the response-requested Waiting on additional info or feedback. Will move to "closing-soon" in 5 days. label Mar 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
guidance Question that needs advice or information.
Projects
None yet
Development

No branches or pull requests

2 participants