[Twisted-Python] stupid case sensitive web clients

Glyph Lefkowitz glyph at twistedmatrix.com
Tue Nov 12 23:53:31 EST 2002

On Tue, 12 Nov 2002 16:40:00 -0500, Bob Ippolito <bob at redivi.com> wrote:
> Well, it's already doing capitalize(), might as well capitalize it the 
> way that everything else does.  It certainly wouldn't break anything to 
> send it with string.capwords(name, '-') instead of name.capitalize().

If I recall correctly, it's doing capitalize() because it was *originally* just
sending the headers lowercase, and somebody else had a broken device and/or
script that was expecting headers to be formatted exactly as they are now (in
particular, Cache-control).

If people are really encountering broken devices like this on a regular basis
(and they seem to be) perhaps it would be best to make the header-formatting
code by default do all-lowercase, but be easily pluggable?  This would have the
advantage of eliminating a bunch of unnecessary string allocations during HTTP
request processing.  Another option would be to have the headers decided on a
case-by-case basis, by looking up in a hashtable.  This would let us have a
little popularity contest to determine how existing servers send their
"case-insensitive" headers and record each decision...

 |    <`'>    |  Glyph Lefkowitz: Traveling Sorcerer   |
 |   < _/ >   |  Lead Developer,  the Twisted project  |
 |  < ___/ >  |      http://www.twistedmatrix.com      |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20021112/8e87a2fd/attachment.pgp 

More information about the Twisted-Python mailing list