Skip to content

The provided 'x-amz-content-sha256' header does not match what was computed. #2

Open

Description

@troggy

I'm getting The provided 'x-amz-content-sha256' header does not match what was computed. error when calling PUT on presigned URL generated with the getPartPresignedRequestInfo.

The hash generated by the lib is e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 and this is a hash of the empty string. Digging into the library I've found out that aws4.sign signs over request.body, but the library doesn't provide the body hence the signature is made on empty body.

How is it working for you?

I made my code working only by using s3.getSignedUrl instead of calling getPartRequest on uploadModule. I can't figure out how to use aws4.sign without providing the body.

Activity

  1. toniopelo commented on May 4, 2022

    @toniopelo
    Owner

    Hmm, weird. I'm not sure that the body property is involved here as presigned part request works on my side whereas I don't provide any body to the aws4.sign(...) call as you can see in modbox codebase. Do you use the client side lib along the backend one ? Could you provide a minimal reproduction code so I could investigate ? @troggy

  2. troggy commented on May 5, 2022

    @troggy
    ContributorAuthor

    Yes, I use both frontend and backend parts. Will make a minimal example

  3. added
    need reproNeed a manimal reproduction to showcase the situation
    on May 17, 2022
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

    need reproNeed a manimal reproduction to showcase the situation

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions