From f0dac4cbf8c60ea8360767fcc764bec60455b7c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Wed, 14 Feb 2024 09:46:24 +0100 Subject: [PATCH] Add explicit return statements --- scrapy/downloadermiddlewares/httpauth.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scrapy/downloadermiddlewares/httpauth.py b/scrapy/downloadermiddlewares/httpauth.py index 97194fa66..9004a887b 100644 --- a/scrapy/downloadermiddlewares/httpauth.py +++ b/scrapy/downloadermiddlewares/httpauth.py @@ -45,7 +45,7 @@ class HttpAuthMiddleware: self, request: Request, spider: Spider ) -> Union[Request, Response, None]: if b"Authorization" in request.headers: - return + return None usr = request.meta.get("http_user", "") pwd = request.meta.get("http_pass", "") if usr or pwd: @@ -56,3 +56,4 @@ class HttpAuthMiddleware: auth = None if auth: request.headers[b"Authorization"] = auth + return None