The issue is that we dump it as a stream, so we do not have a Content-length header. To signal the end of the file to the client, we close the flow.
But likely there are better options in the HTTP protocol, such as chunked encoding, which we should use. This then would allow to keep the connection alive.