Comment (by Florian Apolloner):
I have been digging a bit more in the RFC and I think setting the
`Content-Length` to `0` is actually preferred since it indicates that
there is really no content (which a redirect is allowed to have).
See https://www.rfc-editor.org/rfc/rfc9110#field.content-length:
> Aside from the cases defined above, in the absence of Transfer-Encoding,
an origin server SHOULD send a Content-Length header field when the
content size is known prior to sending the complete header section. This
will allow downstream recipients to measure transfer progress, know when a
received message is complete, and potentially reuse the connection for
additional requests.
--
Ticket URL: <https://code.djangoproject.com/ticket/34989#comment:13>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.