Closed vrischmann closed 3 years ago
A flag to tell the response to close sounds like the right solution.
However, I think we should populate such flag before providing the Response
object to the user, based on the event_mode
and the Request
(in case client sent close
). This will also allow the user to observe the flag and make decisions on that without having to re-implement the logic themselves. While allowed to overwrite the flag, it's the user's responsibility to understand the implications of doing so. (We should definitely provide a comment explaining what the flag/field does)
Hi,
When running in
io_mode = .blocking
, the connection is always closed here, however the response always writesConnection: keep-alive
here.Some clients are fine with this but for example the scraper from VictoriaMetrics isn't.
I fixed this by adding a
close
field inResponse
and writing theConnection: close
header accordingly. I'm not sure if that's the best way to do it but if it's acceptable I can make a PR.Any advice ?