diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2014-11-12 13:33:50 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2014-11-12 13:33:50 (GMT) |
commit | c216c4869921cb9ade491704f945d6f1401ccbcc (patch) | |
tree | 4f72aacd2ea44a4a9fba3312d62873f7ff611602 /Doc/whatsnew | |
parent | ab14088141ab749763e35b7a49e79c368940e12d (diff) | |
download | cpython-c216c4869921cb9ade491704f945d6f1401ccbcc.zip cpython-c216c4869921cb9ade491704f945d6f1401ccbcc.tar.gz cpython-c216c4869921cb9ade491704f945d6f1401ccbcc.tar.bz2 |
Close #19494: add urrlib.request.HTTPBasicPriorAuthHandler
This auth handler adds the Authorization header to the first
HTTP request rather than waiting for a HTTP 401 Unauthorized
response from the server as the default HTTPBasicAuthHandler
does.
This allows working with websites like https://api.github.com which do
not follow the strict interpretation of RFC, but more the dicta in the
end of section 2 of RFC 2617:
> A client MAY preemptively send the corresponding Authorization
> header with requests for resources in that space without receipt
> of another challenge from the server. Similarly, when a client
> sends a request to a proxy, it may reuse a userid and password in
> the Proxy-Authorization header field without receiving another
> challenge from the proxy server. See section 4 for security
> considerations associated with Basic authentication.
Patch by Matej Cepl.
Diffstat (limited to 'Doc/whatsnew')
-rw-r--r-- | Doc/whatsnew/3.5.rst | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.5.rst b/Doc/whatsnew/3.5.rst index 502ac44..e90f5fa 100644 --- a/Doc/whatsnew/3.5.rst +++ b/Doc/whatsnew/3.5.rst @@ -297,6 +297,15 @@ time * The :func:`time.monotonic` function is now always available. (Contributed by Victor Stinner in :issue:`22043`.) +time +---- + +* A new :class:`urllib.request.HTTPBasicPriorAuthHandler` allows HTTP Basic + Authentication credentials to be sent unconditionally with the first HTTP + request, rather than waiting for a HTTP 401 Unauthorized response from the + server. + (Contributed by Matej Cepl in :issue:`19494`.) + wsgiref ------- |