-
Bug
-
Resolution: Done
-
Major
-
5.0.6.Final
-
None
-
None
This change created the following weird-ish behavior:
webTarget .path("/some-path") .request() .header(HttpHeaders.CONTENT_TYPE, "foo") .post(Entity.entity("bar", "text/plain"));
will send Content-Type: foo. You could argue this is understandable, but I think many will think 'last wins', which is the behavior before the change above. Of course, that policy essentially means you can't use header(String, String) to set the Content-Type when you are submitting an Entity.
I do think it's debatable what should be done. I think this is some weirdness with the API. However, this represents a possible breaking change for us, so need to make sure this was intended behavior that will stay.
Update: Also, based on a quick glance, I believe the current code works differently if you use the `headers(map)` method. It will still have the old behavior (i.e. produce `Content-Type: text/plain` in the case above if you use `headers` instead of `header`).
Added AffectsVersion of 5.0.6.Final as that's where we first noticed it.
- is caused by
-
RESTEASY-2874 Web Target Proxy not overriding content type header
- Resolved
- is incorporated by
-
WFLY-18005 Upgrade RESTEasy to 6.2.4.Final
- Closed