Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 89795 invoked from network); 20 May 2008 19:27:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 May 2008 19:27:32 -0000 Received: (qmail 96352 invoked by uid 500); 20 May 2008 19:27:30 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 96298 invoked by uid 500); 20 May 2008 19:27:30 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 96287 invoked by uid 99); 20 May 2008 19:27:30 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 May 2008 12:27:30 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.9] (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 20 May 2008 19:26:44 +0000 Received: (qmail 89683 invoked by uid 2161); 20 May 2008 19:27:05 -0000 Received: from [192.168.2.4] (euler.heimnetz.de [192.168.2.4]) by cerberus.heimnetz.de (Postfix on SuSE Linux 7.0 (i386)) with ESMTP id 94D9B1721C for ; Tue, 20 May 2008 21:26:53 +0200 (CEST) Message-ID: <4833260A.1070301@apache.org> Date: Tue, 20 May 2008 21:27:06 +0200 From: Ruediger Pluem User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.13) Gecko/20080313 SeaMonkey/1.1.9 MIME-Version: 1.0 To: dev@httpd.apache.org Subject: Re: Empty Reason Phrase (BZ 44995/45092) References: <4832CA69.2010204@kippdata.de> In-Reply-To: X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org On 05/20/2008 08:52 PM, Jeff Trawick wrote: > On Tue, May 20, 2008 at 8:56 AM, Rainer Jung wrote: >> It seems that httpd 2.0 and 2.2 require a non empty reason phrase in the >> status line. RFC 2616 allows an empty reason phrase: >> >> 6.1 Status-Line >> >> Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF >> >> 6.1.1 Status Code and Reason Phrase >> >> Reason-Phrase = * >> >> Because of the star (*) I read this as "empty reason phrase is allowed". > > right, there can be 0 repetitions > > my bad ;) > >> Do you agree, that empty reason phrases should be allowed? > > yes > >> If so, the below code fragments should be reviewed. I could provide the >> (trivial) patch. > > replace "<=" with "<" > >> Furthermore there is a second, related problem (for 2.x *and* 1.3): error >> pages use the status line as a title. If the line has an empty reason phrase >> *and* uses a custom http status code, error pages will show the title for >> status code 500. > > looks like this code: > > Index: modules/http/http_protocol.c > =================================================================== > --- modules/http/http_protocol.c (revision 658385) > +++ modules/http/http_protocol.c (working copy) > @@ -1235,12 +1235,12 @@ > * with the 3 digit status code > */ > if (r->status_line != NULL > - && strlen(r->status_line) > 4 /* long enough */ > + && strlen(r->status_line) >= 4 /* long enough */ > && apr_isdigit(r->status_line[0]) > && apr_isdigit(r->status_line[1]) > && apr_isdigit(r->status_line[2]) > && apr_isspace(r->status_line[3]) Do we really need to require the space in the case that the reason phrase is empty? > - && apr_isalnum(r->status_line[4])) { > + && (r->status_line[4] == '\0' || apr_isalnum(r->status_line[4]))) { > title = r->status_line; > } Regards R�diger