-
Notifications
You must be signed in to change notification settings - Fork 595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Empty entity should set Content-Length header #4213
Labels
Comments
bursauxa
pushed a commit
to bursauxa/akka-http
that referenced
this issue
Jan 12, 2023
bursauxa
added a commit
to bursauxa/akka-http
that referenced
this issue
Jan 12, 2023
bursauxa
added a commit
to bursauxa/akka-http
that referenced
this issue
Jan 12, 2023
bursauxa
added a commit
to bursauxa/akka-http
that referenced
this issue
Jan 13, 2023
bursauxa
added a commit
to bursauxa/akka-http
that referenced
this issue
Jan 13, 2023
bursauxa
added a commit
to bursauxa/akka-http
that referenced
this issue
Jan 13, 2023
bursauxa
added a commit
to bursauxa/akka-http
that referenced
this issue
Jan 13, 2023
bursauxa
added a commit
to bursauxa/akka-http
that referenced
this issue
Jan 13, 2023
bursauxa
added a commit
to bursauxa/akka-http
that referenced
this issue
Jan 13, 2023
johanandren
pushed a commit
that referenced
this issue
Jan 25, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When a Play application running on akka-http returns status 205 Reset Content, some clients hang with this response and just wait for it to complete, even though the server considers it is complete and will never send any further data. I have encountered the issue with the following clients:
play-ws-standalone
(with underlying Netty-based AHC), Apache Commonshttp-client
, andcurl
in command line. Some clients do not hang and immediately consider the request complete, such as Chrome or Firefox browsers.It has to do with the fact that the response has no body (which is correct, as mandated by RFC for status 205), and no indication of content length to explicitly say that there is no body. That last part is incorrect behavior according to RFC 7231 section 6.3.6:
It seems the HTTP clients I've identified, do rely on this requirement stated by RFC. Testing with servers that add the
Content-Length: 0
header, they work as expected. Also, they may eventually work if the server reaches its connection timeout before the client does, and thus closes the connection (which is a valid way to complete the response as seen from the client).I found an earlier mention of this issue in 2021 on Gitter but it seems to not have been followed through.
Credit to Ben Fradet for identifying the same issue with Tomcat in 2017; I shamelessly copy-pasted half of his issue on the Apache tracker over here.
The text was updated successfully, but these errors were encountered: