-
Bug
-
Resolution: Done
-
Major
-
None
-
jboss-fuse-6.2.1
-
None
-
%
-
I have a simple CXF jaxrs service deployed in Fabric container. The jaxrs service returns HTTP code 204 "No Content".
When invoking on the service directly, I am getting:
$ curl -v -H "Accept: application/json" -H "Content-Type: application/json" -X POST -d '{"Customer":{"id":113,"name":"Dan"}}' http://0.0.0.0:9080/route/customerservice/customers * Trying 0.0.0.0... * Connected to 0.0.0.0 (127.0.0.1) port 9080 (#0) > POST /route/customerservice/customers HTTP/1.1 > Host: 0.0.0.0:9080 > User-Agent: curl/7.43.0 > Accept: application/json > Content-Type: application/json > Content-Length: 36 > * upload completely sent off: 36 out of 36 bytes < HTTP/1.1 204 No Content < Content-Length: 0 < Date: Fri, 10 Mar 2017 13:13:08 GMT < Server: Jetty(8.1.17.v20150415) < * Connection #0 to host 0.0.0.0 left intact
However, when invoking on the service through Fabric HTTP Gateway, the "Transfer-Encoding" header field was added to the response:
$ curl -v -H "Accept: application/json" -H "Content-Type: application/json" -X POST -d '{"Customer":{"id":113,"name":"Dan"}}' http://0.0.0.0:9000/route/customerservice/customers * Trying 0.0.0.0... * Connected to 0.0.0.0 (127.0.0.1) port 9000 (#0) > POST /route/customerservice/customers HTTP/1.1 > Host: 0.0.0.0:9000 > User-Agent: curl/7.43.0 > Accept: application/json > Content-Type: application/json > Content-Length: 36 > * upload completely sent off: 36 out of 36 bytes < HTTP/1.1 204 No Content < Content-Length: 0 < Date: Fri, 10 Mar 2017 13:13:38 GMT < Server: Jetty(8.1.17.v20150415) < Transfer-Encoding: chunked < * Connection #0 to host 0.0.0.0 left intact
The specification RFC 7230 (https://tools.ietf.org/html/rfc7230) section 3.3.1 clearly stated that the "Transfer-Encoding" header field should not be returned in any response with status 204 (No Content):
A server MUST NOT send a Transfer-Encoding header field in any
response with a status code of 1xx (Informational) or 204 (No
Content). A server MUST NOT send a Transfer-Encoding header field in
any 2xx (Successful) response to a CONNECT request (Section 4.3.6 of
[RFC7231]).
- relates to
-
ENTESB-7600 CXF request via gateway-http add "Content-Length and Transfer-Encoding:chunked" in response headers.
- Closed