mirror of
https://github.com/versity/versitygw.git
synced 2026-09-23 16:34:18 +00:00
A streamed chunked request can leave bytes queued after the handler returns. Reusing that connection lets fasthttp parse those bytes as the next request, allowing a shared upstream proxy connection to mix requests across tenants. Mark chunked requests Connection: close when the middleware cannot safely drain them, preventing leftover bytes from crossing the request boundary. Draining is intentionally skipped because fasthttp's request stream reads past the terminating chunk when probing for EOF and can block waiting for another chunk header. The connection-reuse sacrifice is therefore required to avoid both request desynchronization and delaying the response. Content-Length bodies retain the existing bounded drain behavior.