Strip Transfer-Encoding when a switch-to-GET redirect is made
This commit is contained in:
parent
f3bdbfb01a
commit
69982ed46c
@ -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
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user