fix: Changed GetObject by range success status code from 200 to 206

This commit is contained in:
jonaustin09
2024-05-20 14:48:02 -04:00
parent 28f901ef0e
commit e38c63448d
4 changed files with 66 additions and 16 deletions
+7 -9
View File
@@ -388,14 +388,6 @@ func (c S3ApiController) GetActions(ctx *fiber.Ctx) error {
BucketOwner: parsedAcl.Owner,
})
}
if res == nil {
return SendResponse(ctx, fmt.Errorf("get object nil response"),
&MetaOpts{
Logger: c.logger,
Action: "GetObject",
BucketOwner: parsedAcl.Owner,
})
}
utils.SetMetaHeaders(ctx, res.Metadata)
var lastmod string
@@ -447,11 +439,17 @@ func (c S3ApiController) GetActions(ctx *fiber.Ctx) error {
})
}
return SendResponse(ctx, err,
status := http.StatusOK
if acceptRange != "" {
status = http.StatusPartialContent
}
return SendResponse(ctx, nil,
&MetaOpts{
Logger: c.logger,
Action: "GetObject",
BucketOwner: parsedAcl.Owner,
Status: status,
})
}