Changes between Initial Version and Version 1 of Ticket #34989, comment 5
- Timestamp:
- Nov 22, 2023, 12:59:00 PM (12 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #34989, comment 5
initial v1 1 A redirect response is allowed to have a body, so in order for keep-alive to work, the HTTP server must send either `Content-Length` or `Transfer-Encoding: chunked`. It’s less clear that the WSGI application should be responsible for sending itexplicitly. I would have expected uWSGI to automatically add `Transfer-Encoding` if `Content-Length` is not provided, but evidently it doesn’t.1 A redirect response is allowed to have a body, so in order for keep-alive to work, the HTTP server must send either `Content-Length` or `Transfer-Encoding: chunked`. (Hardly anything in HTTP is really “required”—the server can also indicate the empty body by closing the connection, but then the client might be unable to distinguish that from an error.) It’s less clear that the WSGI application should be responsible for sending one of these headers explicitly. I would have expected uWSGI to automatically add `Transfer-Encoding` if `Content-Length` is not provided, but evidently it doesn’t. 2 2 3 3 This is easy to reproduce without Django, so I don’t think we should feel obligated to avoid fixing this just to have a reproduction recipe.