You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Rob Hartill <ha...@hyperreal.com> on 1995/05/09 18:33:20 UTC
minor bug in http_mime.c (Apache 0.6.2) (fwd)
Patch B95 (for 0.6.3) implements this...
> From mes@fwi.uva.nl Tue May 9 02:24:41 1995
> Subject: minor bug in http_mime.c (Apache 0.6.2)
> To: apache-bugs@mail.apache.org, mes@fwi.uva.nl
> Date: Tue, 9 May 1995 11:24:28 +0200 (MET DST)
> The header parsing for CGI scripts has been significantly accelerated,
> but a small bug was introduced.
>
> A script would return (in the header):
> Content-type: text/html
>
> After parsing and handling by Apache 0.6.2, it had become
> Content-type: text/html
>
> htmlgobble for example does not enjoy reading that extra space.
>
> I fixed it by changing http_mime.c (line: +- 344)
>
> from:
> . return 0; /* pointless ?, i think so, but no harm done */
> . }
> .
> . *l++ = '\0';
> . if(!strcasecmp(w,"Content-type")) {
> .
> . /* Nuke trailing whitespace */
> .
> . char *endp = l + strlen(l) - 1;
> . while (endp > l && isspace(*endp)) *endp-- = '\0';
>
> to:
> . return 0; /* pointless ?, i think so, but no harm done */
> . }
> .
> > for(*l++ = '\0'; *l && isspace(*l); l++);
> . if(!strcasecmp(w,"Content-type")) {
> .
> . /* Nuke trailing whitespace */
> .
> . char *endp = l + strlen(l) - 1;
> . while (endp > l && isspace(*endp)) *endp-- = '\0';
>
> this also ``nukes'' leading whitespace.
> I have no idea if it _should_ nuke leading whitespace for all
> legal header entries, but it sounds right.
>
>
> Regards,
> Arjan
> --
> Arjan de Mes (mes@fwi.uva.nl) Tel: +31-20-525-7501 Fax: ..-7490
> shameless plug: http://www.fwi.uva.nl/~mes/
>