You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Finagle HTTP client doesn't follow HTTP 1.1 spec on keeping connection alive in case of 204 response.
Expected behavior
When receiving request with the following headers:
HTTP/1.1 204 No Content
Server: nginx/1.10.1
Date: Mon, 24 Oct 2016 15:12:11 GMT
Content-Type: application/json
Connection: keep-alive
finagle should not initiate closing of the connection because of the absence of "Content-length", since this is completely valid response, according to HTTP 1.1 spec: https://tools.ietf.org/html/rfc7230#section-3.3.2
A server MUST NOT send a Content-Length header field in any response with a status code of 1xx (Informational) or 204 (No Content)
Actual behavior
Finagle tries to find either "Transfer-Encoding: chunked" or "Content-length: 123" headers. Then failing to find any of them, marks the connection as not kept-alive and closes it.
Steps to reproduce the behavior
Set-up finagle HTTP client to receive 204 response from a server (HTTP 1.1, no "Connection: close" header)
Finagle HTTP client will close the connection.
The text was updated successfully, but these errors were encountered:
Hi @pikazlou! This seems to be a hot topic. There is already a PR concerning this that you might be interested in: #521
We have just merged some work internally similar to this regarding HEAD requests, but it hasn't synced with github yet. I'll try and poke the PR ticket once the sync has happened. It should provide a better foundation for cleaning up some of the conformance issues in finagle.
I'm going to close this ticket as a duplicate of the PR mentioned above. If you feel that this is different in some manner, feel free to reopen it. Feel free to continue the discussion there if necessary.
@bryce-anderson could you suggest any workaround to avoid ConnectionManager closing connection? I've tried adding "Content-length" header inside filter, but it seems ConnectionManager logic is applied before any filtering. So I'm running out of ideas how to solve the issue without forking/patching finagle for my needs.
Right now, I don't think there is a solution. That is part of the motivation for #521. Part of getting us on that direction was done in this commit: fa8cef1
I hope that we can build on that.
Finagle HTTP client doesn't follow HTTP 1.1 spec on keeping connection alive in case of 204 response.
Expected behavior
When receiving request with the following headers:
finagle should not initiate closing of the connection because of the absence of "Content-length", since this is completely valid response, according to HTTP 1.1 spec:
https://tools.ietf.org/html/rfc7230#section-3.3.2
Actual behavior
Finagle tries to find either "Transfer-Encoding: chunked" or "Content-length: 123" headers. Then failing to find any of them, marks the connection as not kept-alive and closes it.
Steps to reproduce the behavior
Set-up finagle HTTP client to receive 204 response from a server (HTTP 1.1, no "Connection: close" header)
Finagle HTTP client will close the connection.
The text was updated successfully, but these errors were encountered: