Skip to content

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

Closed
Closed

Description

@vladilm

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?

Activity

  1. debora-ito commented on Mar 20, 2019

    @debora-ito
    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.

  2. added
    guidance
    response-requested
    on Mar 20, 2019
  3. vladilm commented on Mar 21, 2019

    @vladilm
    Author

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

  4. debora-ito commented on Mar 21, 2019

    @debora-ito
    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.

  5. vladilm commented on Mar 22, 2019

    @vladilm
    Author

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

  6. debora-ito commented on Mar 22, 2019

    @debora-ito
    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.

  7. removed
    response-requested
    on Mar 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    guidance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions