-
Type:
Bug
-
Status: Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.16.2
-
Component/s: camel-restlet
-
Labels:None
-
Estimated Complexity:Moderate
We are trying to bind an incoming POST REST call with Content-Type application/x-www-form-urlencoded to an outgoing one. The incoming request body containing the url encoded form does not get transferred to the outgoing one. We investigated and saw there's a bug in
DefaultRestletBinding.populateRestletRequestFromExchange:180 (2.16.2):
if (request.getMethod() == Method.GET || (request.getMethod() == Method.POST && mediaType == MediaType.APPLICATION_WWW_FORM)) {
The mediaType gets compared using ==. This is wrong. The condition always evaluates to false although the configured Content-Type within the header is "application/x-www-form-urlencoded" (or in our case "application/x-www-form-urlencoded; charset=ISO-8859-1").