[ python-Bugs-994101 ] urllib2: improper capitalization of headers

SourceForge.net noreply at sourceforge.net
Mon Jul 19 23:22:59 CEST 2004


Bugs item #994101, was opened at 2004-07-19 16:22
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=994101&group_id=5470

Category: Python Library
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Robert Sayre (franklinmint)
Assigned to: Nobody/Anonymous (nobody)
Summary: urllib2: improper capitalization of headers

Initial Comment:
urllib2.py version 1.72 uses capitalize() on HTTP
header names. This results in headers like "User-agent"
instead of "User-Agent". This causes HTTP 400 errors on
some servers when the request has a body, because there
are two content length headers placed in the request:

"Content-Length" (inserted by httplib)
"Content-length" (inserted by
Request.add_unredirected_header)

The capitalization is incorrect, and httplib inserts
Content-Length anyway, so I'm not sure why urllib2 is
bothering.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=994101&group_id=5470


More information about the Python-bugs-list mailing list