summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeth M. Larson <SethMichaelLarson@users.noreply.github.com>2018-03-27 14:40:38 -0500
committerGitHub <noreply@github.com>2018-03-27 14:40:38 -0500
commit1742538d57865e61125c6c12a755b5db41636fe7 (patch)
treecd9281930b31dbad38bfb97d7cda1ff8c27d0b0c
parent3b5f27449e153ad05186beca8fbd9b134936fe50 (diff)
downloadurllib3-1742538d57865e61125c6c12a755b5db41636fe7.tar.gz
Add a comment about short-circuiting is_same_host
-rw-r--r--urllib3/poolmanager.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/urllib3/poolmanager.py b/urllib3/poolmanager.py
index 0e4525f9..506a3c9b 100644
--- a/urllib3/poolmanager.py
+++ b/urllib3/poolmanager.py
@@ -337,6 +337,8 @@ class PoolManager(RequestMethods):
retries = Retry.from_int(retries, redirect=redirect)
# Strip headers marked as unsafe to forward to the redirected location.
+ # Check remove_headers_on_redirect to avoid a potential network call within
+ # conn.is_same_host() which may use socket.gethostbyname() in the future.
if (retries.remove_headers_on_redirect
and not conn.is_same_host(redirect_location)):
for header in retries.remove_headers_on_redirect: