Camel HTTP consumer endpoint incorrectly decodes URIs when bridging endpoints

Solution Verified - Updated -

Issue

Consider a simple Camel bridging route like this:

  from("netty-http:http://localhost:9000/camel?matchOnUriPrefix=true")
          .to ("http4://localhost:9000/fred?bridgeEndpoint=true");

It might be expected that HTTP requests made on the consumer endpoint would be issued unchanged on the producer endpoint. In fact, with Camel versions before 2.16, there is an oddity in the handling of encoded request URIs.

If the consumer endpoint receives a request URI like this:

GET /camel/x=%3B HTTP/1.1

the request issued by the producer will be:

GET /camel/x=; HTTP/1.1

The same, of course, applies to other hex-encoded characters. In many cases it is correct behaviour to decode URIs with hex-encoded characters, but when bridging endpoints, developers expect a transfer of the raw data.

This behaviour is seen in the http4 and netty-http endpoints, but not in jetty endpoints.

Environment

  • Red Hat JBoss Fuse
    • 6.1
    • 6.2

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content