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

Added a new method SetUserMetadata to the PostPolicy #178

Merged
merged 3 commits into from Oct 12, 2017
Merged

Added a new method SetUserMetadata to the PostPolicy #178

merged 3 commits into from Oct 12, 2017

Conversation

wowi42
Copy link
Contributor

@wowi42 wowi42 commented Oct 10, 2017

Hi there,

here is a PR for a new feature I need for a project I am working on with @hnb2.

Feature

SetUserSpecifiedMetadata(key string, value string) allows you to add user specified metadata following this guide which mention:

key explanation
x-amz-meta-* User-specified metadata.This condition supports exact matching and starts-with condition match type.

string headerName = "x-amz-meta-" + key;
this.policies.Add(new Tuple<string, string, string>("eq", "$" + headerName, value));
this.formData.Add(headerName, value);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

The SetKey() method already allows the user to set form data, and the custom metadata can be passed in with the x-amz-meta prefix. Is there a reason why an additional method would help

Copy link
Member

Choose a reason for hiding this comment

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

It is coming from here minio/minio-go#839

Copy link
Contributor

@poornas poornas left a comment

Choose a reason for hiding this comment

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

LGTM.

@harshavardhana
Copy link
Member

SetUserSpecifiedMetadata(key string, value string) allows you to add user specified metadata following this guide which mention:

SetUserMetadata(key string, value string) is a better API IMO. Borrowing suggestion by @vadmeste on minio-go PR.

@wowi42 wowi42 changed the title Added a new method SetUserSpecifiedMetadata to the PostPolicy Added a new method SetUserMetadata to the PostPolicy Oct 12, 2017
@wowi42
Copy link
Contributor Author

wowi42 commented Oct 12, 2017

Done

@deekoder deekoder merged commit 55e810b into minio:master Oct 12, 2017
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.

5 participants