[issue12541] Accepting Badly formed headers in urllib HTTPBasicAuth

Alex Leon report at bugs.python.org
Tue Jul 12 15:48:19 CEST 2011


New submission from Alex Leon <aeleon at gmail.com>:

It looks like some servers using basic authentication don't include quotes around the realm (example https://api.connect2field.com) as required by rfc 2617. urllib wont handle these requests and silently fails, but a simple change to the regex in AbstractBasicAuthHandler from
 
'realm=(["\'])(.*?)\\2', re.I)
to
'realm=(["\']?)(["\']*)\\2', re.I)

would make authentication more flexible.

----------
components: Library (Lib)
messages: 140191
nosy: Alex.Leon
priority: normal
severity: normal
status: open
title: Accepting Badly formed headers in urllib HTTPBasicAuth
type: behavior
versions: Python 3.2

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12541>
_______________________________________


More information about the Python-bugs-list mailing list