Currently BlackSheep supports streaming response content using asynchronous generators, and for those always uses transfer-encoding: chunked, meaning that content length is not set as response header, and the length is just determined by the final transmitted chunk.
When implementing a proxy, though, it is best to support proxying responses having a specified content-length even when the response is streamed.
This is to support specifying a content-length when using an async generator. Like in this example:
Currently BlackSheep supports streaming response content using asynchronous generators, and for those always uses
transfer-encoding: chunked
, meaning that content length is not set as response header, and the length is just determined by the final transmitted chunk.When implementing a proxy, though, it is best to support proxying responses having a specified content-length even when the response is streamed.
This is to support specifying a content-length when using an async generator. Like in this example:
⚠️ in such cases, of course, it is the responsibility of the user to configure the right content length.