From 0a72a5009c8d7bc46ac7f82a38e0c885107f8d26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Fri, 15 Nov 2024 17:15:10 +0100 Subject: [PATCH] [common] disable Authorization header injection from .netrc auth (#6134, #6455) --- gallery_dl/extractor/common.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gallery_dl/extractor/common.py b/gallery_dl/extractor/common.py index 4c54d85a..61d35f41 100644 --- a/gallery_dl/extractor/common.py +++ b/gallery_dl/extractor/common.py @@ -1004,6 +1004,12 @@ SSL_CIPHERS = { } +# disable Basic Authorization header injection from .netrc data +try: + requests.sessions.get_netrc_auth = lambda _: None +except Exception: + pass + # detect brotli support try: BROTLI = urllib3.response.brotli is not None