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

Support specifying redirect location for a object #967

Merged
merged 1 commit into from
Apr 23, 2018
Merged

Support specifying redirect location for a object #967

merged 1 commit into from
Apr 23, 2018

Conversation

klausenbusk
Copy link
Contributor

This commit make it possiable to specify the
x-amz-website-redirect-location header for a object, which make it
possible for a object to redirect to another object in the same
bucket or to a external URL. [1]

[1] https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html#page-redirect-using-rest-api

@nitisht nitisht requested review from poornas and nitisht April 18, 2018 15:26
@@ -84,6 +85,9 @@ func (opts PutObjectOptions) Header() (header http.Header) {
if opts.StorageClass != "" {
header[amzStorageClass] = []string{opts.StorageClass}
}
if opts.WebsiteRedirectLocation != "" {
header["x-amz-website-redirect-location"] = []string{opts.WebsiteRedirectLocation}
Copy link
Member

Choose a reason for hiding this comment

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

you should define this as a constant string just like amzStorageClass

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

This commit make it possible to specify the
x-amz-website-redirect-location header for a object, which make it
possible for a object to redirect to another object in the same
bucket or to a external URL. [1]

[1] https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html#page-redirect-using-rest-api
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

ping @nitisht

@nitisht nitisht merged commit 2c10420 into minio:master Apr 23, 2018
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.

4 participants