This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: urllib2: ensure digest auth happens in preference to basic
Type: Stage:
Components: Library (Lib) Versions: Python 2.5
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, jjlee
Priority: normal Keywords: patch

Created on 2006-05-29 15:47 by jjlee, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
digest_first.patch jjlee, 2006-05-29 15:47
Messages (3)
msg50377 - (view) Author: John J Lee (jjlee) Date: 2006-05-29 15:47
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.
msg50378 - (view) Author: John J Lee (jjlee) Date: 2006-05-29 16:39
Logged In: YES 
user_id=261020

Oops, the comment added to
test_basic_and_digest_auth_handlers (which is the second
mention of 1479302 in that test if the patch is applied)
should instead have referred to this tracker item (1497027).

I guess there's no need to upload a new patch just to fix that.
msg50379 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-05-29 20:53
Logged In: YES 
user_id=849994

Applied in rev. 46531.
History
Date User Action Args
2022-04-11 14:56:17adminsetgithub: 43431
2006-05-29 15:47:29jjleecreate