mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Patch #812285: allow multiple auth schemes in AbstractBasicAuthHandler.
This commit is contained in:
		
							parent
							
								
									cadbbfc85b
								
							
						
					
					
						commit
						172e7257f6
					
				
					 1 changed files with 3 additions and 4 deletions
				
			
		|  | @ -767,11 +767,10 @@ def find_user_password(self, realm, authuri): | ||||||
| 
 | 
 | ||||||
| class AbstractBasicAuthHandler: | class AbstractBasicAuthHandler: | ||||||
| 
 | 
 | ||||||
|     rx = re.compile('[ \t]*([^ \t]+)[ \t]+realm="([^"]*)"', re.I) |     # XXX this allows for multiple auth-schemes, but will stupidly pick | ||||||
|  |     # the last one with a realm specified. | ||||||
| 
 | 
 | ||||||
|     # XXX there can actually be multiple auth-schemes in a |     rx = re.compile('(?:.*,)*[ \t]*([^ \t]+)[ \t]+realm="([^"]*)"', re.I) | ||||||
|     # www-authenticate header.  should probably be a lot more careful |  | ||||||
|     # in parsing them to extract multiple alternatives |  | ||||||
| 
 | 
 | ||||||
|     # XXX could pre-emptively send auth info already accepted (RFC 2617, |     # XXX could pre-emptively send auth info already accepted (RFC 2617, | ||||||
|     # end of section 2, and section 1.2 immediately after "credentials" |     # end of section 2, and section 1.2 immediately after "credentials" | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Georg Brandl
						Georg Brandl