[Patches] [ python-Patches-1497027 ] urllib2: ensure digest auth happens in preference to basic

SourceForge.net noreply at sourceforge.net
Mon May 29 17:47:29 CEST 2006


Patches item #1497027, was opened at 2006-05-29 16:47
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1497027&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Library (Lib)
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: John J Lee (jjlee)
Assigned to: Nobody/Anonymous (nobody)
Summary: urllib2: ensure digest auth happens in preference to basic

Initial Comment:
At the moment in urllib2, digest auth is only tried
before basic (as MUST happen according to RFC 2617
section 1.2) only if .add_handler() was called for
HTTPDigestAuthHandler before HTTPBasicAuthHandler. 
This patch ensures that digest is always tried first.

I guess it's unfortunate that sorting of handlers is
done by an attribute rather than by declaring and using
topological sort, since any change to a handler_order
may break code, but that can only be fixed by adding
that as a new feature (probably a new factory).  I
doubt this particular change will catch anybody out,
and it can violate the RFC as-is, so I think this
should go in.  The patch removes the note in the docs
about current values of handler_orders, since that was
already out of date even before this patch.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1497027&group_id=5470


More information about the Patches mailing list