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
* Rebuilt URL to: http://localhost:9000/
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 9000 (#0)
> POST / HTTP/1.0
> Host: localhost:9000
> User-Agent: curl/7.47.0
> Accept: */*
> Connection: keep-alive
> Generated-Response-Size: 2049
>
* HTTP 1.0, assume close after body
<HTTP/1.0 200 OK
<Date:Mon,10Jun201923:34:33GMT<Content-Length:2049< Content-Type: text/plain; charset=utf-8*HTTP/1.0 connection set to keep alive!
**< Connection: keep-alive
<
* Connection #0 to host localhost left intact
What did you see instead?
* Rebuilt URL to: http://localhost:9000/
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 9000 (#0)
> POST / HTTP/1.0
> Host: localhost:9000
> User-Agent: curl/7.47.0
> Accept: */*
> Connection: keep-alive
> Generated-Response-Size: 2049
>
* HTTP 1.0, assume close after body
<HTTP/1.0 200 OK
<Date:Mon,10Jun201923:34:37GMT< Content-Type: text/plain; charset=utf-8<
* Closing connection 0
The expectation is to see Connection #0 to host localhost left intact instead of Closing connection 0 . In the same time, when I pass any number less than 2049 "Generated-Response-Size" I can see the expected output and keepalive supported by the server correctly.
The text was updated successfully, but these errors were encountered:
The Server is making a best effort to generate a Content-Length which is required for Keep-Alive. The default buffer size is 2048 before chunking takes over which is not supported for http 1.0. The result is a response which has no Content-Length and will close the connection.
If you want to guarantee keep-alive with http 1.0, it would be best if you set a Content-Length rather than allow the Server to do its best.
Agree, persistent connections are not parts of any official specs... That should probably be just a known issue for HTTP 1.0, I'm about to close the thread
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I have executed curl with following options
What did you expect to see?
What did you see instead?
The expectation is to see Connection #0 to host localhost left intact instead of Closing connection 0 . In the same time, when I pass any number less than 2049 "Generated-Response-Size" I can see the expected output and keepalive supported by the server correctly.
The text was updated successfully, but these errors were encountered: