Gaetano Giunta | 10 Jan 2005 09:43
Picon

R: xmlrpc.usefulinc.com demo server returns duplicate content lengths.


AFAIK: the HTTP rfc (2616) does mandate that the same header appear only once in a request, unless the
specific header accepts  a csv list of values (which is not the case for content-length). AND header field
names are case-insensitive.

The spec does not mandate how to deal with duplicate headers, so most implementations ususally pick either
the first or the last header received as the meaningful one and ignore the rest.

To sum it up:
- PHP is wrong in sending the content-length twice. And yes, it is the combination php-added-length +
apache-added-length that gives trouble
- Python is wrong too in just joining together the two values. Old behaviour seems better

The funny thing is in this case the two pieces of informations are identical. An old and well known bug with
the php xmlrpc extension had the two values differing by 5 bytes, due Apache calculating length after
chunked encoding and PHP not knowing it

PS To Milosch:

I'd suggest patching the PHP lib to
- Use "Content-Length" instead of "Content-length" (since this seems to be what Apache use and the exact
casing used in the spec)
- Output only one http header per call to Header(), since there seems to be consensus among PHP developers
that sending more headers separated by newline chars is actually wrong and deprecated

Ciao
Gaetano

> -----Messaggio originale-----
> Da: Miles Lott [mailto:milos <at> groupwhere.org]
(Continue reading)

Miles Lott | 11 Jan 2005 00:24

Re: R: xmlrpc.usefulinc.com demo server returns duplicate content lengths.


Makes sense to me.

Gaetano Giunta wrote:
> PS To Milosch:
> 
> I'd suggest patching the PHP lib to
> - Use "Content-Length" instead of "Content-length" (since this seems to be what Apache use and the exact
casing used in the spec)
> - Output only one http header per call to Header(), since there seems to be consensus among PHP developers
that sending more headers separated by newline chars is actually wrong and deprecated
> 
> Ciao
> Gaetano

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/xml-rpc/

<*> To unsubscribe from this group, send an email to:
    xml-rpc-unsubscribe <at> yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/


Gmane