[
https://issues.apache.org/jira/browse/CXF-9235?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Neena Jacob updated CXF-9235:
-----------------------------
Description:
Apache CXF's {{InvocationBuilderImpl.property()}} stores request properties in
the nested {{jaxrs.filter.properties}} map when cleint sets
{{set.content.type.for.empty.request}} by calling
{{builder.property("set.content.type.for.empty.request", "FALSE")}} on the
Invocation.Builder. However, {{Headers.setProtocolHeadersInConnection()}} later
attempts to retrieve {{set.content.type.for.empty.request}} using
{{{}Message.getContextualProperty(){}}}, which only searches the top-level
message context and does not inspect {{{}jaxrs.filter.properties{}}}.
Consequently, the property is never found, and the
{{set.content.type.for.empty.request}} configuration is ignored.
Based on the current implementation, this issue appears to affect multiple
maintained CXF branches. However, I have only verified it with Apache CXF
*3.1.18* and {*}3.5.5{*}.
*Expected Behavior*
When {{set.content.type.for.empty.request}} is set to {{FALSE}} on an
{{{}Invocation.Builder{}}}, the HTTP transport should honor the setting and
suppress the {{Content-Type}} header for requests with an empty entity.
was:
When {{builder.property("set.content.type.for.empty.request", "FALSE")}} is set
on an {{{}Invocation.Builder{}}}, the property is stored in the request context
under the nested {{jaxrs.filter.properties}} map.
Later, the HTTP transport retrieves the property using:
message.getContextualProperty("set.content.type.for.empty.request")
{{Message.getContextualProperty()}} only looks up top-level contextual
properties and does not inspect the nested {{jaxrs.filter.properties}} map. As
a result, the property is never found by the transport layer.
Consequently, the {{set.content.type.for.empty.request}} configuration is
ignored, and the {{Content-Type}} header is still added for empty requests even
when it has been explicitly disabled.
> set.content.type.for.empty.request seems to be ignored in DELETE request
> ------------------------------------------------------------------------
>
> Key: CXF-9235
> URL: https://issues.apache.org/jira/browse/CXF-9235
> Project: CXF
> Issue Type: Bug
> Reporter: Neena Jacob
> Priority: Minor
>
> Apache CXF's {{InvocationBuilderImpl.property()}} stores request properties
> in the nested {{jaxrs.filter.properties}} map when cleint sets
> {{set.content.type.for.empty.request}} by calling
> {{builder.property("set.content.type.for.empty.request", "FALSE")}} on the
> Invocation.Builder. However, {{Headers.setProtocolHeadersInConnection()}}
> later attempts to retrieve {{set.content.type.for.empty.request}} using
> {{{}Message.getContextualProperty(){}}}, which only searches the top-level
> message context and does not inspect {{{}jaxrs.filter.properties{}}}.
> Consequently, the property is never found, and the
> {{set.content.type.for.empty.request}} configuration is ignored.
>
> Based on the current implementation, this issue appears to affect multiple
> maintained CXF branches. However, I have only verified it with Apache CXF
> *3.1.18* and {*}3.5.5{*}.
>
> *Expected Behavior*
> When {{set.content.type.for.empty.request}} is set to {{FALSE}} on an
> {{{}Invocation.Builder{}}}, the HTTP transport should honor the setting and
> suppress the {{Content-Type}} header for requests with an empty entity.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)