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

fix: get ETag from resp.Body rather than resp.Header #2019

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xiangcheng09
Copy link

When I use the CopyObject function with AWS S3, I find the ETag in the response is always an empty string.
According to AWS's latest API Reference1, the variable ETag is in the CopyObjectResult part, not in the header part.
AWS

Therefore, we should modify the source code to get the ETag from cpObjRes rather than resp.Header.Get("ETag").
I did so and got the correct ETag value, which is not an empty string.

I hope you can take this into consideration. If you have any questions, please feel free to ask.

Reference:

Footnotes

  1. https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html

Copy link
Contributor

@klauspost klauspost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I will send a fix for the linter issues (unrelated to your PR)

@klauspost
Copy link
Contributor

Linter fixes in #2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants