F64116045 opened a new pull request, #11088:
URL: https://github.com/apache/ozone/pull/11088

   ## What changes were proposed in this pull request?
   
   S3 Gateway's `EmptyContentTypeFilter` hides an explicitly empty 
`Content-Type` to avoid Jersey treating it as a request media type. However, 
when an S3 client includes the empty header in AWS V4 `SignedHeaders`, removing 
it entirely prevents `StringToSignProducer` from rebuilding the canonical 
request and the operation fails with `InvalidRequest`.
   
   This patch preserves the empty value through the existing 
`X-Ozone-Original-Content-Type` internal header while continuing to hide 
`Content-Type` from Jersey. The existing signature header conversion then 
restores `Content-Type` with an empty value for AWS V4 canonical request 
generation. Unit tests cover both request wrapping and restoration into the 
signature header map.
   
   This keeps the empty Content-Type workaround introduced for HDDS-4856 while 
supporting clients that sign the empty header.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-16251
   
   ## How was this patch tested?
   
   - `mvn -pl :ozone-s3gateway -DskipShade -DskipRecon -DskipDocs test`
   - `mvn -pl :ozone-s3gateway -DskipShade -DskipRecon -DskipDocs 
-Dtest=TestEmptyContentTypeFilter,TestAWSSignatureProcessor test`
   - `./hadoop-ozone/dev-support/checks/checkstyle.sh`
   - `mvn -Pdist -DskipTests -DskipRecon -DskipDocs -Dmaven.javadoc.skip=true 
package`
   - From the ceph/s3-tests checkout: `S3TEST_CONF=<path-to-s3tests.conf> 
python -m pytest -vv 
s3tests/functional/test_headers.py::test_object_create_bad_contenttype_empty`
   
   Generated-by: Codex (OpenAI language model)
   


-- 
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]

Reply via email to