-
Notifications
You must be signed in to change notification settings - Fork 992
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
Gateway: add object metadata #5536
base: main
Are you sure you want to change the base?
Conversation
Thanks,please sign the CLA first. |
@zhijian-pro Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
support User-defined object metadata.
meta := make(map[string]string) | ||
for k, v := range metadata { | ||
k = strings.ToLower(k) | ||
if strings.HasPrefix(k, amzMeta) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s3 metadata does not have a fixed prefix rule.
There are two kinds of object metadata in Amazon S3: system-defined metadata and user-defined metadata. System-defined metadata includes metadata such as the object's creation date, size, and storage class. User-defined metadata is metadata that you can choose to set at the time that you upload an object. This user-defined metadata is a set of name-value pairs. For more information, see System-defined object metadata and User-defined object metadata.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, but I don't understand. The documentation you provide says:
the optional user-defined metadata names must begin with x-amz-meta- to distinguish them from other HTTP headers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Content-Type
Can it be saved now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add a whitelist to support the storage of these system-defined metadata.
Cache-Control,Content-Disposition,Content-Type
These 3 should be supported.
Enable object metadata for s3 gateway
#5367