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

gateway-http append forward-slash(/) to jaxrs extensionMappings url.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • fuse-6.x-GA
    • jboss-fuse-6.3
    • CXF, Fabric8 v1, Gateway
    • None
    • % %
    • Hide
      • Add following to blueprint.xml, so that request maps correctly.
         <jaxrs:extensionMappings>
                 <entry key="pdf/" value="application/pdf" /> <!-- Fabric http gateway adds trailing "/" even on extension mappings -->
            </jaxrs:extensionMappings>
        
      Show
      Add following to blueprint.xml, so that request maps correctly. <jaxrs:extensionMappings> <entry key= "pdf/" value= "application/pdf" /> <!-- Fabric http gateway adds trailing "/" even on extension mappings --> </jaxrs:extensionMappings>
    • Hide
      • Unzip the reproducer_01811246.zip.
      • Build the project using mvn clean install
      • In Linux environment within /home/<username> folder put a pdf file. Rename this pdf file to output.pdf.
      • Create a profile with below Karaf commands
        profile-create --parents feature-cxf gatewayExternsionTest
        profile-edit --bundle mvn:org.jboss.quickstarts.fuse/cxf-rest/6.3.0.redhat-187 gatewayExternsionTest 
        container-create-child root gatewaycontainer
        container-create-child root appcontainer
        container-add-profile gatewaycontainer gateway-http
        
      • Now browse below we get HTTP/1.1 404 Not Found.
        curl -v http://localhost:9000/cxf/CxfRsRouterTest/rest/.pdf
        
      • In gateway-http logs we see
        2017-03-27 14:45:47,695 | INFO  | entloop-thread-0 | HttpGatewayHandler               | 139 - io.fabric8.gateway-core - 1.2.0.redhat-630187 | Proxying request /cxf/CxfRsRouterTest/rest/.pdf to service path: /cxf/CxfRsRouterTest/rest/.pdf/ on service: http://dhcp193-4.pnq.redhat.com:8183/cxf/CxfRsRouterTest/rest reverseServiceUrl: http://0.0.0.0:9000/cxf/CxfRsRouterTest/rest
        
      • Note Proxying request /cxf/CxfRsRouterTest/rest/.pdf to service path: /cxf/CxfRsRouterTest/rest/.pdf/.
      • However if in blueprint.xml, we add following within jaxrs:extenstionMappings tag, than curl above request we get correct output.
        <entry key="pdf/" value="application/pdf" />
        
      Show
      Unzip the reproducer_01811246.zip. Build the project using mvn clean install In Linux environment within /home/<username> folder put a pdf file. Rename this pdf file to output.pdf. Create a profile with below Karaf commands profile-create --parents feature-cxf gatewayExternsionTest profile-edit --bundle mvn:org.jboss.quickstarts.fuse/cxf- rest /6.3.0.redhat-187 gatewayExternsionTest container-create-child root gatewaycontainer container-create-child root appcontainer container-add-profile gatewaycontainer gateway-http Now browse below we get HTTP/1.1 404 Not Found . curl -v http: //localhost:9000/cxf/CxfRsRouterTest/ rest /.pdf In gateway-http logs we see 2017-03-27 14:45:47,695 | INFO | entloop-thread-0 | HttpGatewayHandler | 139 - io.fabric8.gateway-core - 1.2.0.redhat-630187 | Proxying request /cxf/CxfRsRouterTest/ rest /.pdf to service path: /cxf/CxfRsRouterTest/ rest /.pdf/ on service: http: //dhcp193-4.pnq.redhat.com:8183/cxf/CxfRsRouterTest/ rest reverseServiceUrl: http://0.0.0.0:9000/cxf/CxfRsRouterTest/ rest Note Proxying request /cxf/CxfRsRouterTest/rest/.pdf to service path: /cxf/CxfRsRouterTest/rest/.pdf/. However if in blueprint.xml, we add following within jaxrs:extenstionMappings tag, than curl above request we get correct output. <entry key= "pdf/" value= "application/pdf" />

    Attachments

      Issue Links

        Activity

          People

            pantinor@redhat.com Paolo Antinori
            rhn-support-cpandey Chandra Shekhar Pandey (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: