Run pre-commit

This commit is contained in:
Adrián Chaves 2025-01-10 11:32:12 +01:00
parent 0a90681595
commit cb88457f95
1 changed files with 2 additions and 2 deletions

View File

@ -22,14 +22,14 @@ class UriUserInfoMiddleware:
def process_request(self, request, spider):
parsed_url = urlparse_cached(request)
if parsed_url.username is None and parsed_url.password is None:
return
return None
if parsed_url.scheme.startswith("http"):
username_field, password_field = "http_user", "http_pass"
elif parsed_url.scheme.startswith("ftp"):
username_field, password_field = "ftp_user", "ftp_password"
else:
return
return None
for key, value in (
(username_field, parsed_url.username),