On Tue, 12 Nov 2002 16:40:00 -0500, Bob Ippolito
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 |