Bugs item #994101, was opened at 2004-07-19 23:22 Message generated for change (Comment added) made by jlgijsbers 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: Closed >Resolution: Fixed 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. ---------------------------------------------------------------------- >Comment By: Johannes Gijsbers (jlgijsbers) Date: 2005-01-09 15:56 Message: Logged In: YES user_id=469548 This was fixed by the new patch jjlee provided (#997626). ---------------------------------------------------------------------- Comment By: John J Lee (jjlee) Date: 2004-07-25 20:06 Message: Logged In: YES user_id=261020 I've added a comment to 996159 which explains what's wrong and points to a new patch. ---------------------------------------------------------------------- Comment By: Johannes Gijsbers (jlgijsbers) Date: 2004-07-22 22:48 Message: Logged In: YES user_id=469548 Patch is available at http://python.org/sf/996159. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=994101&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com