Skip to content

Commit

Permalink
[1.26] Remove deprecated getheaders() in contrib modules
Browse files Browse the repository at this point in the history
  • Loading branch information
pquentin committed Nov 28, 2022
1 parent 64b7f79 commit 2f6833a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/urllib3/contrib/appengine.py
Expand Up @@ -224,7 +224,7 @@ def urlopen(
)

# Check if we should retry the HTTP response.
has_retry_after = bool(http_response.getheader("Retry-After"))
has_retry_after = bool(http_response.headers.get("Retry-After"))
if retries.is_retry(method, http_response.status, has_retry_after):
retries = retries.increment(method, url, response=http_response, _pool=self)
log.debug("Retry: %s", url)
Expand Down
4 changes: 2 additions & 2 deletions src/urllib3/contrib/ntlmpool.py
Expand Up @@ -69,7 +69,7 @@ def _new_conn(self):
log.debug("Request headers: %s", headers)
conn.request("GET", self.authurl, None, headers)
res = conn.getresponse()
reshdr = dict(res.getheaders())
reshdr = dict(res.headers)
log.debug("Response status: %s %s", res.status, res.reason)
log.debug("Response headers: %s", reshdr)
log.debug("Response data: %s [...]", res.read(100))
Expand Down Expand Up @@ -101,7 +101,7 @@ def _new_conn(self):
conn.request("GET", self.authurl, None, headers)
res = conn.getresponse()
log.debug("Response status: %s %s", res.status, res.reason)
log.debug("Response headers: %s", dict(res.getheaders()))
log.debug("Response headers: %s", dict(res.headers))
log.debug("Response data: %s [...]", res.read()[:100])
if res.status != 200:
if res.status == 401:
Expand Down

0 comments on commit 2f6833a

Please sign in to comment.