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

camel-cxfrs: NPE on GET request with Content-Type header

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.21.1
    • 2.21.3, 2.22.1, 2.23.0
    • camel-cxfrs
    • None
    • Unknown

    Description

      This commit  https://github.com/apache/camel/commit/e4ad40f2eebb68cfde175b171538e26b278f63f6 modified DefaultCxfRsBinding.populateCxfRsResponseFromExchange in a way that causes an NPE on line #116 when a GET request is made with the Content-Type header set. Since Camel copies the request headers into the response, this causes the check for Content-Type to find the header and the code after that assumes that cxfExchange.getOutMessage() is non-null.

      I can work around this by asking clients not to send the Content-Type header (which is generally meaningless for a GET), but I cannot force them not to send it. I think I can also add header filtering before the endpoint is executed to strip the Content-Type header for GET requests, but ideally DefaultCxfRsBinding.populateCxfRsResponseFromExchange would not call cxfExchange.getOutMessage().putIfAbsent if getOutMessage returns null.

      Attachments

        Activity

          People

            ramu11 Ramu
            chribble Chris Ribble
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: