[issue1401] urllib2 302 POST

John J Lee report at bugs.python.org
Tue Dec 2 23:26:06 CET 2008


John J Lee <jjlee at users.sourceforge.net> added the comment:

I think this was actually not a bug, and the fix should not have been
applied.  I guess this comment is just "for the record", as the fix is
probably cruft that can't be removed now, since people will have started
relying on it.

The only way that the Content-Length header could be in req.headers in
the first place is if the user had explicitly requested that it be added
(urllib2 adds that header to .unredirected_hdrs, but not to .headers). 
The user can no doubt provoke all kinds of other errors by adding random
HTTP headers -- what makes this particular one special?  .add_header()
has always been a "you need to know what you're doing, or you'll break
stuff" interface, and it's not really possible to "fix" that (at least
not without changing the meaning of .add_header()).

----------
nosy: +jjlee

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue1401>
_______________________________________


More information about the Python-bugs-list mailing list