1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Fixed #35051 -- Prevented runserver from removing non-zero Content-Length for HEAD requests.

This commit is contained in:
Paul Bailey
2023-12-31 01:32:37 -06:00
committed by GitHub
parent dc26a3d563
commit 9d52e0720f
2 changed files with 40 additions and 0 deletions

View File

@@ -134,6 +134,7 @@ class ServerHandler(simple_server.ServerHandler):
if (
self.environ["REQUEST_METHOD"] == "HEAD"
and "Content-Length" in self.headers
and str(self.headers["Content-Length"]) == "0"
):
del self.headers["Content-Length"]
# HTTP/1.1 requires support for persistent connections. Send 'close' if