HDDS-16251. Preserve signed empty Content-Type during preprocessing - #11088
Open
F64116045 wants to merge 1 commit into
Open
HDDS-16251. Preserve signed empty Content-Type during preprocessing#11088F64116045 wants to merge 1 commit into
F64116045 wants to merge 1 commit into
Conversation
Contributor
Author
|
The behavior before this change was: After this change: |
F64116045
marked this pull request as ready for review
August 22, 2026 17:56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
S3 Gateway's
EmptyContentTypeFilterhides an explicitly emptyContent-Typeto avoid Jersey treating it as a request media type. However, when an S3 client includes the empty header in AWS V4SignedHeaders, removing it entirely preventsStringToSignProducerfrom rebuilding the canonical request and the operation fails withInvalidRequest.This patch preserves the empty value through the existing
X-Ozone-Original-Content-Typeinternal header while continuing to hideContent-Typefrom Jersey. The existing signature header conversion then restoresContent-Typewith 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?
S3TEST_CONF=<path-to-s3tests.conf> python -m pytest -vv s3tests/functional/test_headers.py::test_object_create_bad_contenttype_emptyCI: https://github.com/F64116045/ozone/actions/runs/32574396997