Skip to content
Myr

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

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tom Christie · committed by Tom Christie · parent f3bdbfb · Browse files · 1 file+3 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−1 removed

  • other:+3 added−1 removed

1 file+3 added−1 removed

modified:httpx/middleware.py+3 added-1 removed
149 unmodified lines
150 del headers["Authorization"]151 del headers["Host"]152153 if method != request.method and method == "GET":154 # Strip Content-Length headers when we've switch to a 'GET' request.154 # If we've switch to a 'GET' request, then strip any headers which155 # are only relevant to the request body.156 del headers["Content-Length"]157 del headers["Transfer-Encoding"]158159 return headers160161 def redirect_content(self, request: AsyncRequest, method: str) -> bytes:
8 unmodified lines