This is a repost of the Github question I posted here:
So far I tried the following:
- set resp.stream to the length of the file I am returning (it is a get request)
- don't set resp.stream
- set resp.body instead "resp.body = open(my_file, encoding="utf-8").read()"
- set resp.stream_len to the file size
- don't set resp.stream_len
- set the Content-Length header myself "resp.set_header("Content-Length", "{}".format(statinfo.st_size))"
And for every combination of the above Transfer-Encoding is set to chunked. What am I doing wrong?
I am using Gunicorn as my WSGI server and have Nginx proxying requests to it.
Thanks.