-
Notifications
You must be signed in to change notification settings - Fork 325
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
allow copy_object
with content-type
in metadata
#738
Comments
@vlcinsky , source metadata will be copied automatically to destination if you leave metadata as None in the copy_object call. You should pass metadata in the api call only if it is your intention to replace metadata in the source object.
|
@poornas thanks, I confirm your suggestion to leave setting metadata copied source content-type and content-encoding to target object (I did not use copy_condition too, but this is probably irrelevant). For my use case this works well now. Thanks a lot. In other cases, when user copying object and trying to fix content-type e.g. from |
s3 CopyObject api allows you to entirely replace the metadata or retain the existing metadata on source side at destination, not both. If you want to keep some of the metadata at source and also add different metadata headers - then application needs to first do a stat of the object and get the metadata, then pass it in your copy_object with modifications you might need. |
@poornas the concept you describe is clear and I like it (either implicitly copy all metadata or explicitly define all). Anyway, attempting to change See the PR #739. It allows modifying |
you are right @vlcinsky |
Trying to use
copy_object
to copy an object from one bucket to another.To keep the target object well functional, I need to preserve
Content-Type
andContent-Encoding
headers.Content-Encoding
is possible passing it's value viametadata
.However, I did not succeed with
Content-Type
.The only solution was to edit sources of minio/helpers.py function
is_supported_header
adding value "content-type".This might be the solution, but I am not sure, it does not break anything else.
The text was updated successfully, but these errors were encountered: