-
Bug
-
Resolution: Done
-
Major
-
3.0.19.Final
-
None
The Client clears the Content-Language header when adding the POST body, irrespective of what has be set previously.
This was discovered with the proxy flavour but I suspect this would occur with the regular client as well.
Short root cause analysis
Processing the body parameter invokes method
org.jboss.resteasy.client.jaxrs.internal.proxy.processors.invocation.MessageBodyParameterProcessor.process(ClientInvocationBuilder, Object)
which creates an entity using constructor javax.ws.rs.client.Entity.Entity(T, MediaType, Annotation[]): this constructor creates a new Variant with a null Locale.
Then setting the entity with method org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.setEntity(Entity)
clears the existing Content-Language header because does not perform any null check, which is a problem because the ClientRequestHeaders.setLanguage method has a "remove-if-null" semantic...