mirror of
https://github.com/versity/versitygw.git
synced 2026-09-20 15:04:27 +00:00
feat: adds Location, x-amz-bucket-arn response headers in CreateBucket
Closes #1873
This commit is contained in:
@@ -632,9 +632,21 @@ func (c S3ApiController) CreateBucket(ctx *fiber.Ctx) (*Response, error) {
|
||||
Tags: body.TagSet,
|
||||
},
|
||||
}, updAcl)
|
||||
if err != nil {
|
||||
return &Response{
|
||||
MetaOpts: &MetaOptions{
|
||||
BucketOwner: bucketOwner.Access,
|
||||
},
|
||||
}, err
|
||||
}
|
||||
|
||||
return &Response{
|
||||
MetaOpts: &MetaOptions{
|
||||
BucketOwner: bucketOwner.Access,
|
||||
},
|
||||
}, err
|
||||
Headers: map[string]*string{
|
||||
"Location": utils.GetStringPtr("/" + bucket),
|
||||
"x-amz-bucket-arn": utils.GetStringPtr(auth.ResourceArnPrefix + bucket),
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -888,12 +888,17 @@ func TestS3ApiController_CreateBucket(t *testing.T) {
|
||||
locals: map[utils.ContextKey]any{
|
||||
utils.ContextKeyAccount: adminAcc,
|
||||
},
|
||||
bucket: "my-bucket",
|
||||
},
|
||||
output: testOutput{
|
||||
response: &Response{
|
||||
MetaOpts: &MetaOptions{
|
||||
BucketOwner: adminAcc.Access,
|
||||
},
|
||||
Headers: map[string]*string{
|
||||
"Location": utils.GetStringPtr("/my-bucket"),
|
||||
"x-amz-bucket-arn": utils.GetStringPtr("arn:aws:s3:::my-bucket"),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user