Hello,

we are implementing a http camel route for receiving data from SAP.
The route consumes from a netty-http endpoint(from("netty-http...")).

Our tests with SoapUi worked fine, but when we tried sending data from the
SAP system the test failed with http 400 bad request.
After some research I found https://issues.apache.org/jira/browse/CAMEL-6599
where is mentioned to check if the host appears as http header.

I analyzed the http requests:
SoapUI:
 Accept-Encoding: gzip,deflate[\r][\n]
 Content-Type: text/xml;charset=UTF-8[\r][\n]
 Content-Length: 4[\r][\n]
 *Host: host-123:8080[\r][\n]*
 Connection: Keep-Alive[\r][\n]
 User-Agent: Apache-HttpClient/4.1.1 (java 1.5)[\r][\n]

SAP:
    content-type: text/xml; charset=utf-8\r\n
    content-length: 3391\r\n
        [Content length: 3391]
    connection: keep-alive\r\n
    accept-encoding: gzip, deflate\r\n
    user-agent: SAP NetWeaver Application Server (1.0;731)\r\n
   * host: host-123:8080\r\n*
    sap-language: D\r\n

The camel netty http component checks if a "Host" http header exists(case
sensitive), SAP sends "host":
org.apache.camel.component.netty.http.handlers.HttpServerChannelHandler: 
 // must include HOST header as required by HTTP 1.1
if (!request.headers().names().contains(HttpHeaders.Names.HOST)) {
HttpResponse response = new DefaultHttpResponse(HTTP_1_1, BAD_REQUEST);
response.setChunked(false);
response.headers().set(Exchange.CONTENT_TYPE, "text/plain");
response.headers().set(Exchange.CONTENT_LENGTH, 0);
response.setContent(ChannelBuffers.copiedBuffer(new byte[]{}));
messageEvent.getChannel().write(response).syncUninterruptibly();
messageEvent.getChannel().close();
return;
}

HttpHeaders can be/have to be case insensitive, see
http://stackoverflow.com/questions/5258977/are-http-headers-case-sensitive
or http://www.ietf.org/rfc/rfc2616.txt.

Should I create a ticket for this?

kind regards,
soilworker



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-Netty-Http-HttpHeaders-case-sensitive-tp5763157.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to