fix Invocation.Builder.property() not visible to HTTP transport - #3375
Open
neenapj wants to merge 1 commit into
Open
fix Invocation.Builder.property() not visible to HTTP transport#3375neenapj wants to merge 1 commit into
neenapj wants to merge 1 commit into
Conversation
Author
|
@ffang Could you please take a look at this PR when you get a chance? |
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.
Fixes CXF-9235
Made changes to
InvocationBuilderImpl.property()to write directly into contextProps, matching how Client/WebTarget already behave.Tests added (InvocationBuilderImplTest)
testPropertyWrittenToBothFilterPropsAndFlatContextsetsSET_EMPTY_REQUEST_CT_PROPERTY = falseviaInvocation.Builder.property()and asserts two storage locations onClientConfiguration.getRequestContext():(a) filterProps sub-map (
requestContext.get("jaxrs.filter.properties")): consumed byClientRequestFilter.getProperty()viaMessagePropertyHolder. This path was always written; the test guards it stays working.(b) flat top-level map (
requestContext.get("set.content.type.for.empty.request")): consumed by the HTTP transport viaMessage.getContextualProperty()inHeaders.setProtocolHeadersInConnection(). This was the CXF-9235 bug — only (a) was written, so the transport silently ignored the property. The test fails on (b) when the fix is reverted (expected: but was:), and passes once the flat write is restored. The test also verifies that passing null removes the property from both locations.No network call is made — the test inspects the ClientConfiguration map directly, since
InvocationBuilderImpl.property()populates it synchronously before any dispatch.