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

CopyObject with Metadata directive "REPLACE" does not update system metadata #2005

Closed
raymondregrello opened this issue Jul 30, 2024 · 3 comments · Fixed by #2064
Closed
Assignees
Labels

Comments

@raymondregrello
Copy link

Repro steps:

  1. Create object A using PutObject with "Content-Disposition" set to ""
  2. Call CopyObject with src and dst pointing to object A, metadata directive set to "REPLACE" and "Content-Disposition" set to "attachment"

Result:
operation error S3: CopyObject, https response error StatusCode: 400, RequestID: , HostID: , api error InvalidRequest: This copy request is illegal because it is trying to copy an object to itself without changing the object's metadata, storage class, website redirect location or encryption attributes.

Expected:
The object should be updated in place with the new "Content-Disposition" value

@afranken afranken self-assigned this Aug 2, 2024
@afranken
Copy link
Member

afranken commented Aug 7, 2024

@raymondregrello
does this work against the S3 API?
"Content-Disposition" is not part of the objects metadata, so S3 should return the same error.

@raymondregrello
Copy link
Author

@afranken Thanks for taking a look at this!

It does work with the S3 API. "Content-Disposition" is part of the system metadata that users can modify:
https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingMetadata.html#SysMetadata

afranken added a commit that referenced this issue Sep 27, 2024
The headers we store as "storeHeaders" are part of the
"System-defined object metadata" which can be the only metadata
overwritten when copying objects.

Fixes #2005
@afranken afranken added the bug label Sep 27, 2024
@raymondregrello
Copy link
Author

Thank you! :)

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

Successfully merging a pull request may close this issue.

2 participants