[#486] Fix PUT object with negative Content-Length #490

Merged
alexvanin merged 2 commits from mbiryukova/frostfs-s3-gw:bugfix/negative_content_length into master 2024-09-16 08:45:47 +00:00
Member

Closes #486

Closes #486
mbiryukova self-assigned this 2024-09-12 15:53:06 +00:00
mbiryukova added 2 commits 2024-09-12 15:53:07 +00:00
Signed-off-by: Marina Biryukova <m.biryukova@yadro.com>
[#486] Fix PUT object with negative Content-Length
All checks were successful
/ DCO (pull_request) Successful in 48s
/ Vulncheck (pull_request) Successful in 1m13s
/ Builds (pull_request) Successful in 1m27s
/ Lint (pull_request) Successful in 2m25s
/ Tests (pull_request) Successful in 1m27s
e8804e2df1
Signed-off-by: Marina Biryukova <m.biryukova@yadro.com>
mbiryukova requested review from storage-services-committers 2024-09-12 15:55:45 +00:00
mbiryukova requested review from storage-services-developers 2024-09-12 15:55:45 +00:00
mbiryukova force-pushed bugfix/negative_content_length from e8804e2df1 to 72c680dd5e 2024-09-13 09:54:19 +00:00 Compare
alexvanin reviewed 2024-09-13 10:36:16 +00:00
@ -266,3 +269,4 @@
CreationTime: TimeNow(ctx),
CopiesNumber: p.CopiesNumbers,
}
if p.Size != nil {
Owner

What you think about keeping p.Size as an int, not a pointer, and using p.Size > 0 instead of p.Size != nil?
Isn't it the same but safer due to lack of pointers?

What you think about keeping `p.Size` as an int, not a pointer, and using `p.Size > 0` instead of `p.Size != nil`? Isn't it the same but safer due to lack of pointers?
Author
Member

There may be a case (theoretically) when we put empty multipart object and should save 0 as a size

There may be a case (theoretically) when we put empty multipart object and should save 0 as a size
alexvanin marked this conversation as resolved
alexvanin approved these changes 2024-09-16 08:45:39 +00:00
alexvanin merged commit f187141ae5 into master 2024-09-16 08:45:47 +00:00
alexvanin deleted branch bugfix/negative_content_length 2024-09-16 08:45:50 +00:00
Sign in to join this conversation.
No reviewers
TrueCloudLab/storage-services-developers
No milestone
No project
No assignees
2 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#490
No description provided.