Skip to content

fix Invocation.Builder.property() not visible to HTTP transport - #3375

Open
neenapj wants to merge 1 commit into
apache:mainfrom
neenapj:CXF-9235
Open

fix Invocation.Builder.property() not visible to HTTP transport#3375
neenapj wants to merge 1 commit into
apache:mainfrom
neenapj:CXF-9235

Conversation

@neenapj

@neenapj neenapj commented Aug 14, 2026

Copy link
Copy Markdown

Fixes CXF-9235

Made changes to InvocationBuilderImpl.property() to write directly into contextProps, matching how Client/WebTarget already behave.

Tests added (InvocationBuilderImplTest)

testPropertyWrittenToBothFilterPropsAndFlatContext sets SET_EMPTY_REQUEST_CT_PROPERTY = false via Invocation.Builder.property() and asserts two storage locations on ClientConfiguration.getRequestContext():

(a) filterProps sub-map (requestContext.get("jaxrs.filter.properties")): consumed by ClientRequestFilter.getProperty() via MessagePropertyHolder. 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 via Message.getContextualProperty() in Headers.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.

@neenapj

neenapj commented Aug 14, 2026

Copy link
Copy Markdown
Author

@ffang Could you please take a look at this PR when you get a chance?

@ffang ffang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution @neenapj !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants