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.

Author jjlee
Recipients BitTorment, facundobatista, frispete, jjlee, orsenthil
Date 2008-10-25.12:08:32
SpamBayes Score 1.110223e-16
Marked as misclassified No
Message-id <1224936518.6.0.253268201154.issue2275@psf.upfronthosting.co.za>
In-reply-to
Content
I have attached a patch that just:

 * Improves doctests a bit
 * Changes .get_headers() and .has_header() to be case-insensitive
 * Documents .get_header() and .header_items(), fixes some
incorrectly-documented argument names, and notes the case-sensitivity change
 * Note that the headers passed to httplib (the original issue for which
this bug was raised) were already correctly Title-Cased, and that is
unchanged by this patch

Options:

 * Apply my patch.  I'd be happy with this.
 * Apply my patch and begin the process of deprecating public interfaces
.unredirected_hdrs and .headers.  Perhaps provide another interface to
tell whether a header will be redirected (only if there's a use case for
that).  I'd be happy with this too.
 * Bring back Senthil's case-normalized .headers and .unredirected_hdrs
and document those interfaces.  This a bad idea, because this would
result in a very confusing set of interfaces for dealing with headers
(see my previous comments on this -- Date: 2008-07-11 19:44).

(For what it's worth, I have also attached a doctest to show some
examples of the broken invariants issue with Senthil's patch.  The
doctest also comments on the fact that making .headers case-insensitive
in this way is quite confusing in the case where multiple items of
different case are present, but __getitem__ returns only a single item
-- this is a relatively minor issue, but still worth avoiding.  The
variation of choosing to discard items that normalize to the same string
would avoid this problem, though it might break working code that relies
on sending multiple headers with differing case, so I think this would
be no better overall.)
History
Date User Action Args
2008-10-25 12:08:38jjleesetrecipients: + jjlee, facundobatista, orsenthil, frispete, BitTorment
2008-10-25 12:08:38jjleesetmessageid: <1224936518.6.0.253268201154.issue2275@psf.upfronthosting.co.za>
2008-10-25 12:08:37jjleelinkissue2275 messages
2008-10-25 12:08:35jjleecreate