Message70542
I am submitting a revised patch for this issue.
I did some analysis on the history of this issue and found that this
.capitalize() vs .title() changes had come up earlier too (
issue1542948)and decision was taken to:
- To retain the Header format in .capitalize() to maintain backward
compatibility.
- However, when the headers are passed to httplib, they are converted to
.title() format ( see AbstractHTTPHandler method )
- It is encouraged that users uses .add_header(), .has_header(),
.get_header() methods to check for headers instead of using the .headers
dict directly (which will still remain undocumented interface).
Note to Hans-Peter would be: Changing the headers to .title() tends to
make the .header_items() retrieval backward incompatible, so the headers
will still be stored in .capitalize() format.
And I have made the following changes to the patch:
1) Support for case insensitive dict look up which will work with for
.has_header, .get_header(). So when .has_header("User-Agent") will
return True even when .headers give {"User-agent":"blah"}
2) Added tests to tests the behavior.
3) Changes to doc to reflect upon this issue.
Btw, the undocumented .headers interface will also support
case-insensitive lookup, so I have added tests for that too.
Let me know if you have any comments. Lets plan to close this issue.
Thanks, |
|
Date |
User |
Action |
Args |
2008-08-01 06:12:24 | orsenthil | set | recipients:
+ orsenthil, facundobatista, jjlee, frispete, BitTorment |
2008-08-01 06:12:24 | orsenthil | set | messageid: <1217571144.69.0.26412253846.issue2275@psf.upfronthosting.co.za> |
2008-08-01 06:12:23 | orsenthil | link | issue2275 messages |
2008-08-01 06:12:21 | orsenthil | create | |
|