mirror of
https://github.com/python/cpython.git
synced 2025-10-17 12:18:23 +00:00
merge from 3.2 - Issue #12541: Be lenient with quotes around Realm field of HTTP Basic Authentation in urllib2.
This commit is contained in:
commit
b26fe2f313
3 changed files with 19 additions and 1 deletions
|
@ -895,7 +895,7 @@ class AbstractBasicAuthHandler:
|
|||
# allow for double- and single-quoted realm values
|
||||
# (single quotes are a violation of the RFC, but appear in the wild)
|
||||
rx = re.compile('(?:.*,)*[ \t]*([^ \t]+)[ \t]+'
|
||||
'realm=(["\'])(.*?)\\2', re.I)
|
||||
'realm=(["\']?)([^"\']*)\\2', re.I)
|
||||
|
||||
# XXX could pre-emptively send auth info already accepted (RFC 2617,
|
||||
# end of section 2, and section 1.2 immediately after "credentials"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue