Skip to content

Commit 4616dba

Browse files
committed
requests: update comment about the "Host" header
Update the comment to explain the reason for poping out "Host" header from headers. Ths host in the redirect URL may not be the same as the original URL, pop out "Host" in headers before redirect would force using the host specified in the redirect URL. Signed-off-by: 黃昕暐 <[email protected]>
1 parent 1e68c60 commit 4616dba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python-ecosys/requests/requests/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def request(
180180

181181
if redirect:
182182
s.close()
183-
# use the Host in the redirect URL
183+
# Use the host specified in the redirect URL, as it may not be the same as the original URL.
184184
headers.pop("Host", None)
185185
if status in [301, 302, 303]:
186186
return request("GET", redirect, None, None, headers, stream)

0 commit comments

Comments
 (0)