Browse Source

s3api: add error code and header constants for GetObjectAttributes

Add ErrInvalidAttributeName error code and header constants
(X-Amz-Object-Attributes, X-Amz-Max-Parts, X-Amz-Part-Number-Marker,
X-Amz-Delete-Marker) needed by the S3 GetObjectAttributes API.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
pull/8504/head
Chris Lu 3 days ago
parent
commit
3b439e0e7b
  1. 6
      weed/s3api/s3_constants/header.go
  2. 8
      weed/s3api/s3err/s3api_errors.go

6
weed/s3api/s3_constants/header.go

@ -45,6 +45,12 @@ const (
AmzObjectTaggingDirective = "X-Amz-Tagging-Directive"
AmzTagCount = "x-amz-tagging-count"
// GetObjectAttributes headers
AmzObjectAttributes = "X-Amz-Object-Attributes"
AmzMaxParts = "X-Amz-Max-Parts"
AmzPartNumberMarker = "X-Amz-Part-Number-Marker"
AmzDeleteMarker = "X-Amz-Delete-Marker"
SeaweedFSUploadId = "X-Seaweedfs-Upload-Id"
SeaweedFSMultipartPartsCount = "X-Seaweedfs-Multipart-Parts-Count"
SeaweedFSMultipartPartBoundaries = "X-Seaweedfs-Multipart-Part-Boundaries" // JSON: [{part:1,start:0,end:2,etag:"abc"},{part:2,start:2,end:3,etag:"def"}]

8
weed/s3api/s3err/s3api_errors.go

@ -143,6 +143,8 @@ const (
// Bucket encryption errors
ErrNoSuchBucketEncryptionConfiguration
ErrInvalidStorageClass
ErrInvalidAttributeName
)
// Error message constants for checksum validation
@ -600,6 +602,12 @@ var errorCodeResponse = map[ErrorCode]APIError{
Description: "The storage class you specified is not valid",
HTTPStatusCode: http.StatusBadRequest,
},
ErrInvalidAttributeName: {
Code: "InvalidArgument",
Description: "Invalid attribute name specified",
HTTPStatusCode: http.StatusBadRequest,
},
}
// GetAPIError provides API Error for input API error code.

Loading…
Cancel
Save