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

Merged
merged 1 commit into from
Jan 18, 2025

Conversation

xiangcheng09
Copy link
Contributor

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

@harshavardhana harshavardhana merged commit c18789f into minio:master Jan 18, 2025
9 of 15 checks passed
@xiangcheng09 xiangcheng09 deleted the fix-etag branch January 18, 2025 14:28
@xiangcheng09
Copy link
Contributor Author

Thank you all. This is very exciting for a beginner. ♥

DennisRasey pushed a commit to DennisRasey/forgejo that referenced this pull request Jan 21, 2025
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/minio/minio-go/v7](https://github.com/minio/minio-go) | require | patch | `v7.0.83` -> `v7.0.84` |

---

### Release Notes

<details>
<summary>minio/minio-go (github.com/minio/minio-go/v7)</summary>

### [`v7.0.84`](https://github.com/minio/minio-go/releases/tag/v7.0.84): Bugfix Release

[Compare Source](minio/minio-go@v7.0.83...v7.0.84)

#### What's Changed

-   fix: use Hostname instead of Host in s3utils.GetRegionFromURL by [@&#8203;huanghaoyuanhhy](https://github.com/huanghaoyuanhhy) in minio/minio-go#2046
-   feat: CopyObject md demo update by [@&#8203;767829413](https://github.com/767829413) in minio/minio-go#2017
-   fix: get ETag from resp.Body rather than resp.Header by [@&#8203;xiangcheng09](https://github.com/xiangcheng09) in minio/minio-go#2019
-   move to go1.23 CI by [@&#8203;harshavardhana](https://github.com/harshavardhana) in minio/minio-go#2050
-   Use default STS endpoints when using empty STS endpoint with IAM by [@&#8203;ramondeklein](https://github.com/ramondeklein) in minio/minio-go#2051

#### New Contributors

-   [@&#8203;huanghaoyuanhhy](https://github.com/huanghaoyuanhhy) made their first contribution in minio/minio-go#2046
-   [@&#8203;767829413](https://github.com/767829413) made their first contribution in minio/minio-go#2017
-   [@&#8203;xiangcheng09](https://github.com/xiangcheng09) made their first contribution in minio/minio-go#2019

**Full Changelog**: minio/minio-go@v7.0.83...v7.0.84

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "* 0-3 * * *" (UTC), Automerge - "* 0-3 * * *" (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMDYuMCIsInVwZGF0ZWRJblZlciI6IjM5LjEwNi4wIiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6629
Reviewed-by: Michael Kriese <[email protected]>
Co-authored-by: Renovate Bot <[email protected]>
Co-committed-by: Renovate Bot <[email protected]>
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