mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-08 23:37:43 +02:00
s3api: check attributes query before versionId in action resolver
Move the GetObjectAttributes action check before the versionId check in resolveFromQueryParameters. This fixes GET /bucket/key?attributes&versionId=xyz being incorrectly classified as s3:GetObjectVersion instead of s3:GetObjectAttributes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
b2ec00558a
commit
b92c61c95c
1 file changed
+7
-5
@@ -159,6 +159,13 @@ func resolveFromQueryParameters(query url.Values, method string, hasObject bool)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetObjectAttributes (object-level only)
|
||||||
|
// Must be checked before versionId, because GET /bucket/key?attributes&versionId=xyz
|
||||||
|
// is a GetObjectAttributes request, not a GetObjectVersion request
|
||||||
|
if hasObject && query.Has("attributes") && method == http.MethodGet {
|
||||||
|
return s3_constants.S3_ACTION_GET_OBJECT_ATTRIBUTES
|
||||||
|
}
|
||||||
|
|
||||||
// Versioning operations - distinguish between versionId (specific version) and versions (list versions)
|
// Versioning operations - distinguish between versionId (specific version) and versions (list versions)
|
||||||
// versionId: Used to access/delete a specific version of an object (e.g., GET /bucket/key?versionId=xyz)
|
// versionId: Used to access/delete a specific version of an object (e.g., GET /bucket/key?versionId=xyz)
|
||||||
if query.Has("versionId") {
|
if query.Has("versionId") {
|
||||||
@@ -196,11 +203,6 @@ func resolveFromQueryParameters(query url.Values, method string, hasObject bool)
|
|||||||
return s3_constants.S3_ACTION_GET_BUCKET_LOCATION
|
return s3_constants.S3_ACTION_GET_BUCKET_LOCATION
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetObjectAttributes (object-level only)
|
|
||||||
if hasObject && query.Has("attributes") && method == http.MethodGet {
|
|
||||||
return s3_constants.S3_ACTION_GET_OBJECT_ATTRIBUTES
|
|
||||||
}
|
|
||||||
|
|
||||||
// Object retention and legal hold operations (object-level only)
|
// Object retention and legal hold operations (object-level only)
|
||||||
if hasObject {
|
if hasObject {
|
||||||
if query.Has("retention") {
|
if query.Has("retention") {
|
||||||
|
|||||||
Reference in new issue
Block a user