Return-Path: owner-new-httpd Received: by taz.hyperreal.com (8.6.10/8.6.5) id HAA14216; Tue, 21 Mar 1995 07:47:02 -0800 Received: from ooo.lanl.gov by taz.hyperreal.com (8.6.10/8.6.5) with SMTP id HAA14206; Tue, 21 Mar 1995 07:46:59 -0800 Received: by ooo.lanl.gov (1.38.193.4/16.2) id AA04020; Tue, 21 Mar 1995 08:46:54 -0700 From: Rob Hartill Message-Id: <9503211546.AA04020@ooo.lanl.gov> Subject: Re: change LF to CRLF ? To: new-httpd@hyperreal.com Date: Tue, 21 Mar 95 8:46:54 MST In-Reply-To: ; from "David Robinson" at Mar 21, 95 2:34 pm Organization: Theoretical Division, T-8. Los Alamos National Laboratory Address: LANL Theoretical Divi' T-8, MS B285, P.O Box 1663, Los Alamos NM 87545 Fax: (505) 667 5585 Phone: (505) 665-2280 or 667-5336 (T-8 Secretary) Mailer: Elm [revision: 70.85] Sender: owner-new-httpd@hyperreal.com Precedence: bulk Reply-To: new-httpd@hyperreal.com > > On Mon, 20 Mar 95 16:54:09 MST, Rob Hartill wrote: > > The offending bit of code wasn't in stream.c, it was in > > scan_script_header() > > > > if (p > 0 && w[p-1] == '\n') > > { > > if (p > 1 && w[p-2] == '\015') w[p-2] = '\0'; > > else w[p-1] = '\0'; > > } > > if(w[0] == '\0') return is_url(location); > > > > > >should be, > > > > if (p > 0 && w[p-1] == LF) > > w[p-1] = '\0'; > > > > if(!w[0] || (p>0 && w[0] == CR && !w[1])) return is_url(location); > > > >I suppose. > > Sorry, Rob, no. There was nothing wrong with that code. You are assuming > that the CGI script will return CRLF terminated headers. This assumption > will be wrong for the vast majority of CGI scripts. Hmm, I tried it with a CGI script that output LF with no CR. The result was output of a LF with no CR - which I'd consider to be correct. Even though the spec calls for CRLF, I don't think the server should be changing the cgi output. Unless there is a problem elsewhere, the 'fix' I gave was only leaving CRs where they belong, instead of removing or adding them. I can see that correcting the cgi headers would be useful, but I'm not sure it's the right thing to do here. Neither method should break anything, but it's just my gut feeling that cgi supplied info should be passed as-is. rob