Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-9664

DefaultRestletBinding.populateRestletRequestFromExchange uses wrong mediaType comparison

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.16.2
    • Fix Version/s: 2.16.3, 2.17.0
    • Component/s: camel-restlet
    • Labels:
      None
    • Estimated Complexity:
      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").

        Attachments

          Activity

            People

            • Assignee:
              davsclaus Claus Ibsen
              Reporter:
              wblancqu Wouter Blancquaert
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: