Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.16.2
-
None
-
Moderate
Description
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").