Strip Transfer-Encoding when a switch-to-GET redirect is made

This commit is contained in:
Tom Christie 2019-09-04 15:10:55 +01:00
parent f3bdbfb01a
commit 69982ed46c

View File

@ -151,8 +151,10 @@ class RedirectMiddleware(BaseMiddleware):
del headers["Host"]
if method != request.method and method == "GET":
# Strip Content-Length headers when we've switch to a 'GET' request.
# If we've switch to a 'GET' request, then strip any headers which
# are only relevant to the request body.
del headers["Content-Length"]
del headers["Transfer-Encoding"]
return headers