mirror of https://github.com/scrapy/scrapy.git
Run pre-commit
This commit is contained in:
parent
0a90681595
commit
cb88457f95
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Reference in New Issue