Replying to a 1.0 request with a 1.1 response is perfectly fine. It is the default for a fresh Apache install on a request for a simple static file, for example.
-Rasmus Christian Schneider wrote:
Hi all, I ran into the following problem I would like to get an opinion on: We noticed that our website returns a HTTP/1.1 chunked response even when the request was a HTTP/1.0 request (e.g. php file_get_contents). What happens: - Wordpress (wrongly) set the result code with a hardcoded @header("HTTP/1.1 $header $text", true, $header); - PHP 5.2.1 (IMHO wrongly) patches the protocol in sapi/apache2handler/sapi_apache2.c function php_apache_sapi_send_headers, probably because "force-response-1.1" does not exist (at least not in any production version): ctx->r->proto_num = 1000 + (sline[7]-'0'); - Apache thinks the request was 1.1 and under some circumstances decides to switch to Transfer-Encoding chunked. I think the following should be done: - Ask Wordpress to use $_SERVER['SERVER_PROTOCOL'] when available instead of a hardcoded HTTP/1.1 (I'll do that) - Update the PHP header() documentation to mention this. I was also thinking that supporting/documenting header(null, true, 404); or the like would be nice for people who only want to set the return code and leave the HTTP type unchanged. - Maybe change php_apache_sapi_send_headers to not mess with proto_num. This make it impossible to force the response to HTTP/1.1 but I don't think that should be done anyway as the client might not expect it. For the same reason I think the line apr_table_set(ctx->r->subprocess_env, "force-response-1.1", "true"); should probably be removed as well... Should I open a bug report on this? Regards, - Chris
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php