Skip to content

Commit

Permalink
camel-jetty use HTTP1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jonomorris committed Sep 28, 2024
1 parent af8af95 commit 075e199
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ protected RouteBuilder createRouteBuilder() {
public void configure() {
from("direct:start").setHeader("SOAPAction", constant("http://xxx.com/interfaces/ticket"))
.setHeader("Content-Type", constant("text/xml; charset=utf-8"))
.setHeader(Exchange.HTTP_PROTOCOL_VERSION, constant("HTTP/1.0"))
.setHeader(Exchange.HTTP_PROTOCOL_VERSION, constant("HTTP/1.1"))
.to("http://localhost:{{port}}/myapp/mytest");

from("jetty:http://localhost:{{port}}/myapp/mytest").process(new Processor() {
public void process(Exchange exchange) {
Map<String, Object> headers = exchange.getIn().getHeaders();
ServletRequest request = exchange.getIn(HttpMessage.class).getRequest();
assertNotNull(request);
assertEquals("HTTP/1.0", request.getProtocol(), "Get a wong http protocol version");
assertEquals("HTTP/1.1", request.getProtocol(), "Get a wong http protocol version");
for (Entry<String, Object> entry : headers.entrySet()) {
if ("SOAPAction".equals(entry.getKey())
&& "http://xxx.com/interfaces/ticket".equals(entry.getValue())) {
Expand Down

0 comments on commit 075e199

Please sign in to comment.