[common] prevent exception when using empty 'user-agent' (#8116)

use '"headers": {"User-Agent": ""}' to send an empty User-Agent header
This commit is contained in:
Mike Fährmann
2025-08-26 09:08:49 +02:00
parent dadf405803
commit 5a5857bafb

View File

@@ -462,7 +462,7 @@ class Extractor():
headers["Referer"] = self.root + "/"
custom_ua = self.config("user-agent")
if custom_ua is None or custom_ua == "auto":
if not custom_ua or custom_ua == "auto":
pass
elif custom_ua == "browser":
headers["User-Agent"] = _browser_useragent(None)