File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -856,8 +856,16 @@ class AbstractBasicAuthHandler:
856856
857857 # allow for double- and single-quoted realm values
858858 # (single quotes are a violation of the RFC, but appear in the wild)
859- rx = re .compile ('(?:.*,)*[ \t ]*([^ \t ]+)[ \t ]+'
860- 'realm=(["\' ]?)([^"\' ]*)\\ 2' , re .I )
859+
860+ rx = re .compile ('(?:^|,)' # start of the string or ','
861+ '[ \t ]*' # optional whitespaces
862+ '([^ \t ]+)' # scheme like "Basic"
863+ '[ \t ]+' # mandatory whitespaces
864+ # realm=xxx
865+ # realm='xxx'
866+ # realm="xxx"
867+ 'realm=(["\' ]?)([^"\' ]*)\\ 2' ,
868+ re .I )
861869
862870 # XXX could pre-emptively send auth info already accepted (RFC 2617,
863871 # end of section 2, and section 1.2 immediately after "credentials"
You can’t perform that action at this time.
0 commit comments