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

Allow empty contentTypeStartsWith in PostPolicy #1710

Conversation

skirsten
Copy link
Contributor

The S3 spec allows this:

https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-HTTPPOSTConstructPolicy.html#sigv4-ConditionMatching

Matching Any Content
To configure the POST policy to allow any content within a form field, use starts-with with an empty value ("").

With this change

policy.SetContentTypeStartsWith("")

allows the uploader to specify any content-type they want.

@vadmeste
Copy link
Member

Thanks for the PR @skirsten

Can you add a comment to the function description to say empty is supported ?

@skirsten skirsten force-pushed the post-policy-allow-empty-content-type-starts-with branch from 671ccef to 2feee97 Compare October 17, 2022 14:21
Copy link
Member

@vadmeste vadmeste 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 harshavardhana merged commit 4acfae7 into minio:master Oct 21, 2022
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.

None yet

3 participants