This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author orsenthil
Recipients BitTorment, facundobatista, orsenthil, zathras
Date 2008-08-14.07:29:35
SpamBayes Score 9.831201e-10
Marked as misclassified No
Message-id <1218698995.26.0.974357871044.issue2756@psf.upfronthosting.co.za>
In-reply-to
Content
The submitted patch has problems. It does not correctly solve this issue
(which I want to confirm, if there is issue at all after understanding
the logic behind unredirected_headers). My explanation of this issue and
comments on the patch is here:
http://urllib-gsoc.blogspot.com/2008/08/issue2756-urllib2-addheader-fails-with.html

Now, coming back to the current issue. We see that addition of
unredirected_hdrs takes place in the do_request_ call of
AbstractHTTPHandler and it adds the unredirected_hdrs based on certain
conditions, like when Content-Type is not there in header add the
unredirected header ('Content-Type','application/x-www-form-urlencoded')
The value of Content-Type is hardcoded here, but other header values are
not hardcoded and got from header request only.

Question here is: When the request contains the Content-Type header and
has a updated value, why is it not supposed to change the
unredirected_header to the updated value?  (Same for other request
header items).

John J Lee, can perhaps help us understand more.

If it is supposed to change, then the following snippet (rough) at
do_request_
for key, value in request.headers:
      request.add_unredirected_header(key,request.get_header(key))
should update it, there is no need to change the add_header and
add_unredirected_header method as proposed by the patch.

On our conclusion, I shall provide the updated patch (if required).

Thanks,
Senthil
History
Date User Action Args
2008-08-14 07:29:55orsenthilsetrecipients: + orsenthil, facundobatista, zathras, BitTorment
2008-08-14 07:29:55orsenthilsetmessageid: <1218698995.26.0.974357871044.issue2756@psf.upfronthosting.co.za>
2008-08-14 07:29:36orsenthillinkissue2756 messages
2008-08-14 07:29:35orsenthilcreate