diff options
author | coletdjnz <coletdjnz@protonmail.com> | 2023-12-20 19:15:38 +1300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-20 19:15:38 +1300 |
commit | 196eb0fe77b78e2e5ca02c506c3837c2b1a7964c (patch) | |
tree | 924856c35ebb39015baefdc5c10799541d12cc83 /yt_dlp/utils/networking.py | |
parent | db8b4edc7d0bd27da462f6fe82ff6e13e3d68a04 (diff) |
[networking] Strip whitespace around header values (#8802)
Fixes https://github.com/yt-dlp/yt-dlp/issues/8729
Authored by: coletdjnz
Diffstat (limited to 'yt_dlp/utils/networking.py')
-rw-r--r-- | yt_dlp/utils/networking.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/yt_dlp/utils/networking.py b/yt_dlp/utils/networking.py index ed0250011..4b73252cb 100644 --- a/yt_dlp/utils/networking.py +++ b/yt_dlp/utils/networking.py @@ -67,7 +67,7 @@ class HTTPHeaderDict(collections.UserDict, dict): def __setitem__(self, key, value): if isinstance(value, bytes): value = value.decode('latin-1') - super().__setitem__(key.title(), str(value)) + super().__setitem__(key.title(), str(value).strip()) def __getitem__(self, key): return super().__getitem__(key.title()) |