Skip to content

Commit

Permalink
cleanup after revert
Browse files Browse the repository at this point in the history
  • Loading branch information
coletdjnz committed Mar 15, 2024
1 parent 4286b81 commit cd0074d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 0 additions & 1 deletion test/test_networking.py
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,6 @@ def test_impersonate(self, handler, params, extensions):
# Check that user agent is added over ours
assert 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36' in res

@pytest.mark.parametrize('handler', ['CurlCFFI'], indirect=True)
def test_headers(self, handler):
with handler(headers=std_headers) as rh:
# Ensure curl-impersonate overrides our standard headers (usually added
Expand Down
1 change: 1 addition & 0 deletions yt_dlp/networking/impersonate.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ def _get_impersonate_headers(self, request):
headers = self._merge_headers(request.headers)
if self._get_request_target(request) is not None:
# remove all headers present in std_headers
# todo: change this to not depend on std_headers
for header in std_headers:
if header in headers and std_headers[header] == headers[header]:
headers.pop(header, None)
Expand Down

0 comments on commit cd0074d

Please sign in to comment.