Closed waldreiter closed 2 years ago
CC @neild
I haven't dug into precisely what happens in this scenario, but I strongly suspect you'll get the behavior you want if you set a Content-Length
header in your handler.
The reason for the change in behavior at 2048 bytes is that that's the cutoff for how much data the server will read from the response body before deciding it doesn't know the content length.
I tested setting the Content-Length
and it worked.
My Actix Web server does not set the Content-Length
, but there it works anyway. But I guess that`s life.
Your explanation makes sense. Thank you!
What version of Go are you using (
go version
)?go1.17.6 darwin/amd64
Does this issue reproduce with the latest release?
Yes
What did you do?
A go server that responses with some text larger than 2 kB:
ApacheBench calls it many times:
What did you expect to see?
ApacheBench should run successfully.
What did you see instead?
Some observations
Keep-Alive requests
.Keep-Alive requests
is used on all of them.