[Twisted-Python] HTTP Header names for stupid clients

Bob Ippolito bob at redivi.com
Sun May 12 20:23:05 MDT 2002


I've seen some poorly written embedded clients bonk out if the 
capitalization of http headers isn't Studly-Caps ..  maybe someone 
should add something like:
name='-'.join(map(string.capitalize,name.split('-')))

to http.Request._sendHeader(name,value)  ?

I mean, you're already capitalizing it higher up the tree (in write).. 
but string.capitalize only does the first char, not the first char after 
the hyphen.  Also, you're sending 'Transfer-encoding' not 
'Transfer-Encoding' as one might expect.

I don't know, it's totally bad form for the clients to be that stupid, 
but it's something to consider.

-bob





More information about the Twisted-Python mailing list