Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:29114 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46573 invoked by uid 1010); 30 Apr 2007 23:05:42 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 46557 invoked from network); 30 Apr 2007 23:05:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Apr 2007 23:05:42 -0000 Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lerdorf.com from 204.11.219.139 cause and error) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 204.11.219.139 mail.lerdorf.com Received: from [204.11.219.139] ([204.11.219.139:56191] helo=mail.lerdorf.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7E/BD-42224-44676364 for ; Mon, 30 Apr 2007 19:05:41 -0400 Received: from belowcolor.corp.yahoo.com (belowcolor.corp.yahoo.com [216.145.53.78]) (authenticated bits=0) by mail.lerdorf.com (8.13.8/8.13.8/Debian-3) with ESMTP id l3UN5Vmg009329; Mon, 30 Apr 2007 16:05:35 -0700 Message-ID: <4636763B.3000305@lerdorf.com> Date: Mon, 30 Apr 2007 16:05:31 -0700 User-Agent: Thunderbird 2.0.0.0 (X11/20070326) MIME-Version: 1.0 To: Christian Schneider CC: internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.90.2/3184/Mon Apr 30 06:51:57 2007 on colo X-Virus-Status: Clean Subject: Re: [PHP-DEV] Setting HTTP results code vs. HTTP type From: rasmus@lerdorf.com (Rasmus Lerdorf) 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 >