Changes between Initial Version and Version 1 of Ticket #34989, comment 5


Ignore:
Timestamp:
Nov 22, 2023, 12:59:00 PM (13 months ago)
Author:
Anders Kaseorg

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 it explicitly. I would have expected uWSGI to automatically add `Transfer-Encoding` if `Content-Length` is not provided, but evidently it doesn’t.
     1A 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.
    22
    33This 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.
Back to Top