Skip to content

Commit

Permalink
Use response.headers instead of response.getheaders()
Browse files Browse the repository at this point in the history
response.getheaders() will be deprecated by urllib3.

Fixes #194
  • Loading branch information
user234683 committed Feb 17, 2024
1 parent 684d777 commit 3883407
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def proxy_site(env, start_response, video=False):
else:
response, cleanup_func = util.fetch_url_response(url, send_headers)

response_headers = response.getheaders()
response_headers = response.headers
#if isinstance(response_headers, urllib3._collections.HTTPHeaderDict):
# response_headers = response_headers.items()
try:
Expand Down
2 changes: 1 addition & 1 deletion youtube/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ def fetch_url(url, headers=(), timeout=15, report_text=None, data=None,
)
)
):
print(response.status, response.reason, response.getheaders())
print(response.status, response.reason, response.headers)
ip = re.search(
br'IP address: ((?:[\da-f]*:)+[\da-f]+|(?:\d+\.)+\d+)',
content)
Expand Down

0 comments on commit 3883407

Please sign in to comment.