Skip to content
Myr

Unquote the URL before extracting the auth.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Cory Benfield · committed by Cory Benfield · parent 4f786e4 · Browse files · 1 file+3 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−2 removed

  • other:+3 added−2 removed

1 file+3 added−2 removed

modified:requests/utils.py+3 added-2 removed
19 unmodified lines
2021from . import __version__22from . import certs23from .compat import parse_http_list as _parse_list_header24from .compat import (quote, urlparse, bytes, str, OrderedDict, urlunparse,25 is_py2, is_py3, builtin_str, getproxies, proxy_bypass)24from .compat import (quote, urlparse, bytes, str, OrderedDict, unquote, is_py2,25 builtin_str, getproxies, proxy_bypass)26from .cookies import RequestsCookieJar, cookiejar_from_dict27from .structures import CaseInsensitiveDict28from .exceptions import MissingSchema, InvalidURL29
527 unmodified lines
557def get_auth_from_url(url):558 """Given a url with authentication components, extract them into a tuple of559 username,password."""560 if url:561 url = unquote(url)562 parsed = urlparse(url)563 return (parsed.username, parsed.password)564 else:565 return ('', '')
19 unmodified lines