Message104609
On Fri, Apr 30, 2010 at 01:56:01AM +0000, R. David Murray wrote:
>
> I seem to have been missing some context here.
I was referring to Walter's comment on default being an int, like
HTTPResponse.getheader('Fake-Content-Length',default=42). It was
surprising to me, but the he provided a sample snippet and pointed out
that default value can be None. So, yes, just checking of string value
might not give the correct results in all circumstances (esp
default=None case which is strong).
>In the 2.x code getheader returns only the value of the first header
>with the given name, in the 3.x code it returns the comma separated
>concatenation of the values of all headers with that name, and breaks
>the handling of default.
>
> Any idea which handling of header values is actually the correct
> behavior vis-a-vis the http protocol?
I believe, 2.x version is proper. I was surprised at get_all() method
introduced too, instead of getheader (if its present in Message)
Headers is a simply a dict and getheader is similar to dict.get(key,
default). I shall look up the HTTP RFC and confirm what should be done
if multiple values exists for same header. |
|
Date |
User |
Action |
Args |
2010-04-30 02:26:06 | orsenthil | set | recipients:
+ orsenthil, barry, hdiogenes, r.david.murray, Walter.Woods |
2010-04-30 02:26:04 | orsenthil | link | issue8572 messages |
2010-04-30 02:26:03 | orsenthil | create | |
|