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

Gateway: add object metadata #5536

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

prOOrc
Copy link
Contributor

@prOOrc prOOrc commented Jan 9, 2025

Enable object metadata for s3 gateway
#5367

@prOOrc prOOrc requested a review from CaitinChen as a code owner January 9, 2025 12:38
@CLAassistant
Copy link

CLAassistant commented Jan 9, 2025

CLA assistant check
All committers have signed the CLA.

@zhijian-pro
Copy link
Contributor

Thanks,please sign the CLA first.

@prOOrc
Copy link
Contributor Author

prOOrc commented Jan 15, 2025

@zhijian-pro Done.

Copy link
Contributor

@zhijian-pro zhijian-pro left a comment

Choose a reason for hiding this comment

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

meta := make(map[string]string)
for k, v := range metadata {
k = strings.ToLower(k)
if strings.HasPrefix(k, amzMeta) {
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor

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?

Copy link
Contributor

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.

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.

3 participants