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

S3 proxy ListParts max parts issue #338

Merged
merged 7 commits into from
Dec 13, 2023

Conversation

0x180
Copy link
Contributor

@0x180 0x180 commented Dec 13, 2023

Fixed max-parts property issue in ListParts action to pass nil if the property is not provided
Added .vscode in gitignore(didn't want to create another PR for this)

@@ -92,7 +92,7 @@ func (c S3ApiController) GetActions(ctx *fiber.Ctx) error {
}

if uploadId != "" {
if maxParts < 0 || (maxParts == 0 && ctx.Query("max-parts") != "") {
if (maxParts < 0 && ctx.Request().URI().QueryArgs().Has("max-parts")) || maxParts > 2147483647 {
Copy link
Member

Choose a reason for hiding this comment

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

better to use math.MaxInt32 instead of 2147483647 so its clear where this number comes from

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed this check: it's unnecessary. If max-parts is larger than math.MaxInt32 it will result the variable value to be -1 and it will return the error

@benmcclelland benmcclelland merged commit e9f01c8 into main Dec 13, 2023
5 checks passed
@benmcclelland benmcclelland deleted the fix/s3proxy-listparts-max-parts branch December 13, 2023 18:22
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.

2 participants