Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:29113 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 98498 invoked by uid 1010); 30 Apr 2007 16:35:40 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 98483 invoked from network); 30 Apr 2007 16:35:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Apr 2007 16:35:40 -0000 X-Host-Fingerprint: 195.226.9.186 unknown Received: from [195.226.9.186] ([195.226.9.186:29672] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A4/E8-40858-9DA16364 for ; Mon, 30 Apr 2007 12:35:39 -0400 Message-ID: To: internals@lists.php.net Date: Mon, 30 Apr 2007 18:35:33 +0200 User-Agent: Thunderbird 1.5.0.10 (X11/20060911) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Posted-By: 195.226.9.186 Subject: Setting HTTP results code vs. HTTP type From: cschneid@cschneid.com (Christian Schneider) 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