What is the proper way to handle Content-Length when writing body content in Owin middleware?
We are currently using
context.Response.Write(data);
In most cases, this works, but in some (IIS host on Win 2012 R2) the Content-Length is set to 0.
I thought that setting the Content-Length header or whether Transfer-Encoding: chuncked could be used depends on how the host is handled, but it looks like I missed something.
What is the correct way to handle Content-Length when writing body content to an OWIN response stream?
We also discussed a bug in the github issue .
source share