Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-15435

camel undertow component forces to set "text/plain" even Rest DSL sets "application/json" to "produces" option

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • fuse-7.9-GA
    • fuse-7.7-GA
    • Camel
    • None
    • False
    • False
    • % %
    • +
    • Undefined
    • Hide
      • download the attached code ready project
      • unzip it and start the camel route
      • using curl command or soapui, send a get request to localhost:8005/test/demo/ping
      • check the response content-type. 
        • expected value: application/json
        • actual value: text/plainreproduer.zip
      Show
      download the attached code ready project unzip it and start the camel route using curl command or soapui, send a get request to localhost:8005/test/demo/ping check the response content-type.  expected value: application/json actual value: text/plain reproduer.zip

    Description

      Even Rest DSL sets "application/json" to "produces" option, camel-undertow overrides the content-type header values with "text/plain" when the exchange body is null.

          <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
              <restConfiguration bindingMode="auto" component="undertow"
                  contextPath="test" host="localhost" port="8005"/>
              <rest id="rest-0b0215bd-f133-46f8-968c-4fe21ba4af4f" path="demo">
                  <get id="get-1" produces="application/json" uri="/ping">
                      <description>direct:hello</description>
                      <route>
                          <to uri="direct:hello"/>
                      </route>
                  </get>
              </rest>
              <route id="simple-route">
                  <from id="_from1" uri="direct:hello"/>
                  <setBody id="_setBody1">
                      <simple>${null}</simple>
                  </setBody>
                  <log id="route-log" message=">>> ${body}"/>
              </route>
          </camelContext>
      

      At least, Rest DSL with jetty component does response with "application/json" content-type header.

      Attachments

        Activity

          People

            rhn-support-tasato Tadayoshi Sato
            rhn-support-hfuruich Hisao Furuichi
            Francesco Mongiardo Francesco Mongiardo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: