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

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

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 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)
Member

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)
Author
Member

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))
Member

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),
Member

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
Member

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.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-s3-gw#399
No description provided.