diff options
author | Harmen Stoppels <harmenstoppels@gmail.com> | 2024-05-01 16:01:47 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-01 16:01:47 (GMT) |
commit | 759e8e7ab83848c527a53d7b2051bc14ac7b7c76 (patch) | |
tree | abf1ce47e94ca537bdb5101ba41acae54721fa97 /Lib/urllib | |
parent | 49baa656cb994122869bc807a88ea2f3f0d7751b (diff) | |
download | cpython-759e8e7ab83848c527a53d7b2051bc14ac7b7c76.zip cpython-759e8e7ab83848c527a53d7b2051bc14ac7b7c76.tar.gz cpython-759e8e7ab83848c527a53d7b2051bc14ac7b7c76.tar.bz2 |
gh-99730: urllib.request: Keep HEAD method on redirect (GH-99731)
Diffstat (limited to 'Lib/urllib')
-rw-r--r-- | Lib/urllib/request.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py index d22af66..ac6719c 100644 --- a/Lib/urllib/request.py +++ b/Lib/urllib/request.py @@ -650,6 +650,7 @@ class HTTPRedirectHandler(BaseHandler): newheaders = {k: v for k, v in req.headers.items() if k.lower() not in CONTENT_HEADERS} return Request(newurl, + method="HEAD" if m == "HEAD" else "GET", headers=newheaders, origin_req_host=req.origin_req_host, unverifiable=True) |