[#399] Add OPTIONS method for object operations #399

Merged
alexvanin merged 1 commits from mbiryukova/frostfs-s3-gw:bugfix/object_options into master 2024-06-04 12:59:52 +00:00
Collaborator

Signed-off-by: Marina Biryukova m.biryukova@yadro.com

Signed-off-by: Marina Biryukova <m.biryukova@yadro.com>
mbiryukova self-assigned this 2024-05-31 14:06:08 +00:00
mbiryukova added 1 commit 2024-05-31 14:06:10 +00:00
/ DCO (pull_request) Failing after 2m6s Details
/ Vulncheck (pull_request) Successful in 2m34s Details
/ Builds (1.20) (pull_request) Successful in 3m38s Details
/ Builds (1.21) (pull_request) Successful in 3m20s Details
/ Lint (pull_request) Successful in 4m15s Details
/ Tests (1.20) (pull_request) Successful in 2m13s Details
/ Tests (1.21) (pull_request) Successful in 2m1s Details
def61b0594
[#xxx] Add OPTIONS method for object operations
Signed-off-by: Marina Biryukova <m.biryukova@yadro.com>
mbiryukova force-pushed bugfix/object_options from def61b0594 to 52363f7903 2024-05-31 14:06:45 +00:00 Compare
mbiryukova changed title from [#xxx] Add OPTIONS method for object operations to [#399] Add OPTIONS method for object operations 2024-05-31 14:07:01 +00:00
mbiryukova requested review from storage-services-committers 2024-06-03 07:44:11 +00:00
mbiryukova requested review from storage-services-developers 2024-06-03 07:44:11 +00:00
mbiryukova force-pushed bugfix/object_options from 52363f7903 to 3a5f28b007 2024-06-03 07:48:42 +00:00 Compare
dkirillov reviewed 2024-06-03 09:33:58 +00:00
@ -190,2 +190,2 @@
w.Header().Set(api.AccessControlAllowOrigin, o)
w.Header().Set(api.AccessControlAllowMethods, strings.Join(rule.AllowedMethods, ", "))
w.Header().Set(api.AccessControlAllowOrigin, origin)
w.Header().Set(api.AccessControlAllowMethods, method)
Collaborator

Why do we need these changes?
And if we really need this we should add test for this (currently tests pass with or without these changes)

Why do we need these changes? And if we really need this we should add test for this (currently tests pass with or without these changes)
Poster
Collaborator

Changed according to spec. I will add test

Changed according to [spec](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTOPTIONSobject.html#RESTOPTIONSobject-responses). I will add test
dkirillov marked this conversation as resolved
api/router.go Outdated
@ -224,3 +224,3 @@
bktRouter.Mount("/", objectRouter(h, log))
bktRouter.Options("/", h.Preflight)
bktRouter.Options("/", named(s3middleware.OptionsOperation, h.Preflight))
Collaborator

Maybe we should distinguish bucket options operation and object options operation (I mean naming s3middleware.OptionsOperation)

Maybe we should distinguish bucket options operation and object options operation (I mean naming `s3middleware.OptionsOperation`)
dkirillov marked this conversation as resolved
api/router.go Outdated
@ -373,1 +373,3 @@
objRouter.Use(s3middleware.AddObjectName(l))
objRouter.Use(
s3middleware.AddObjectName(l),
s3middleware.WrapHandler(h.AppendCORSHeaders),
Collaborator

I'm not sure we need this. Because we have already add (and invoke) this handler in bktRouter, so in object router we inherit it. Currently h.AppendCORSHeaders is being invoked twice for every object request

I'm not sure we need this. Because we have already add (and invoke) this handler in bktRouter, so in object router we inherit it. Currently `h.AppendCORSHeaders` is being invoked twice for every object request
dkirillov marked this conversation as resolved
mbiryukova force-pushed bugfix/object_options from 3a5f28b007 to 06edda6c5f 2024-06-03 12:14:34 +00:00 Compare
dkirillov approved these changes 2024-06-03 13:16:55 +00:00
dkirillov left a comment
Collaborator

LGTM

LGTM
pogpp approved these changes 2024-06-03 14:07:21 +00:00
alexvanin added this to the v0.30.0 milestone 2024-06-04 12:59:40 +00:00
alexvanin merged commit e25dc90c20 into master 2024-06-04 12:59:52 +00:00
alexvanin deleted branch bugfix/object_options 2024-06-04 13:00:15 +00:00
alexvanin modified the milestone from v0.30.0 to v0.29.1 2024-06-18 11:02:24 +00:00
Sign in to join this conversation.
There is no content yet.