mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
gh-99730: urllib.request: Keep HEAD method on redirect (GH-99731)
This commit is contained in:
parent
49baa656cb
commit
759e8e7ab8
3 changed files with 11 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue