Gargi-jais11 opened a new pull request, #10265:
URL: https://github.com/apache/ozone/pull/10265
## What changes were proposed in this pull request?
Currently, the Ozone S3 Gateway does not return the `x-amz-tagging-count`
header when a **HEAD** request is made against an object.
Per the AWS S3 specification, this header should indicate the total number
of tags associated with the object. This causes failures in compatibility
suites like `s3-tests (specifically test_get_obj_head_tagging)`.
**Proposed Fix:**
> Modify the ObjectEndpoint.head() method to retrieve the tag set for the
requested object. If tags exist, count them and append the x-amz-tagging-count
header to the HTTP response.
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-15258
## How was this patch tested?
Added unit test in `TestObjectHead`.
Tested manually:
**Before Fix:**
```
bash-5.1$ aws s3api put-object-tagging --bucket buck1 --key k1 --tagging
'TagSet=[{Key=tag1,Value=v1},{Key=tag2,Value=v2}]' --endpoint-url
http://s3g:9878
bash-5.1$ aws s3api get-object-tagging --bucket buck1 --key k1
--endpoint-url http://s3g:9878
{
"TagSet": [
{
"Key": "tag1",
"Value": "v1"
},
{
"Key": "tag2",
"Value": "v2"
}
]
}
bash-5.1$ aws s3api head-object --bucket buck1 --key k1 --endpoint-url
http://s3g:9878/ --debug 2>&1 | grep -i 'tagging-count\|x-amz-tagging'
<---------- x-amz-tagging Not present --------------->
```
**After Fix:**
```
bash-5.1$ aws s3api put-object-tagging --bucket buck1 --key key1 --tagging
'TagSet=[{Key=tag1,Value=v1},{Key=tag2,Value=v2}]' --endpoint-url
http://s3g:9878
bash-5.1$ aws s3api get-object-tagging --bucket buck1 --key key1
--endpoint-url http://s3g:9878
{
"TagSet": [
{
"Key": "tag1",
"Value": "v1"
},
{
"Key": "tag2",
"Value": "v2"
}
]
}
bash-5.1$ aws s3api head-object --bucket buck1 --key key1 --endpoint-url
http://s3g:9878 \
--debug 2>&1 | grep -i 'tagging-count\|x-amz-tagging'
2026-05-14 06:31:02,559 - MainThread - botocore.parsers - DEBUG - Response
headers:
{
'Date': 'Thu, 14 May 2026 06:31:02 GMT',
'Cache-Control': 'no-cache',
'Expires': 'Thu, 14 May 2026 06:31:02 GMT',
'Pragma': 'no-cache',
'Content-Type': 'binary/octet-stream',
'X-Content-Type-Options': 'nosniff',
'X-XSS-Protection': '1; mode=block',
'X-FRAME-OPTIONS': 'SAMEORIGIN',
'x-amz-storage-class': 'STANDARD',
'Last-Modified': 'Thu, 14 May 2026 06:25:17 GMT',
'x-amz-tagging-count': '2',
<------------------------ present after fix
'Server': 'Ozone',
'x-amz-id-2': 'zak2tBOJ0hnDdLw',
'x-amz-request-id': 'b1b92416-e79a-4a5d-9a4a-486089dbcd67',
'Content-Length': '25'
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]