10 Jan 2005 09:43
R: xmlrpc.usefulinc.com demo server returns duplicate content lengths.
Gaetano Giunta <giunta.gaetano <at> sea-aeroportimilano.it>
2005-01-10 08:43:18 GMT
2005-01-10 08:43:18 GMT
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)
RSS Feed