Skip to content

Commit cb309b3

Browse files
authored
[utils] HTTPHeaderDict: Fix __ior__ (#16930)
Authored by: doe1080
1 parent e476912 commit cb309b3

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

test/test_utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2172,6 +2172,10 @@ def test_http_header_dict(self):
21722172
headers6 = HTTPHeaderDict(a=1, b=2)
21732173
self.assertEqual(pickle.loads(pickle.dumps(headers6)), headers6)
21742174

2175+
headers7 = HTTPHeaderDict()
2176+
headers7 |= {'X-dlp': 'data'}
2177+
self.assertEqual(headers7.sensitive(), {'X-dlp': 'data'})
2178+
21752179
def test_extract_basic_auth(self):
21762180
assert extract_basic_auth('http://:foo.bar') == ('http://:foo.bar', None)
21772181
assert extract_basic_auth('http://foo.bar') == ('http://foo.bar', None)

yt_dlp/utils/networking.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def __ior__(self, other, /):
6464
other = other.sensitive()
6565
if isinstance(other, dict):
6666
self.update(other)
67-
return
67+
return self
6868
return NotImplemented
6969

7070
def __or__(self, other, /) -> typing.Self:

0 commit comments

Comments
 (0)