Received: (qmail 14420 invoked by uid 2012); 12 Dec 1998 06:36:50 -0000 Message-Id: <19981212063650.14419.qmail@hyperreal.org> Date: 12 Dec 1998 06:36:50 -0000 From: Dave Bodenstab Reply-To: imdave@mcs.net To: apbugs@hyperreal.org Subject: A .gif file named `xxx.cgi.gif' apparently mistaken for a CGI script X-Send-Pr-Version: 3.2 >Number: 3526 >Category: general >Synopsis: A .gif file named `xxx.cgi.gif' apparently mistaken for a CGI script >Confidential: no >Severity: non-critical >Priority: medium >Responsible: apache >State: closed >Class: sw-bug >Submitter-Id: apache >Arrival-Date: Fri Dec 11 22:40:00 PST 1998 >Last-Modified: Fri Dec 11 22:41:54 PST 1998 >Originator: imdave@mcs.net >Organization: >Release: 1.3.3 >Environment: Uname -a: FreeBSD base486.home.org 2.0.5-950622-SNAP FreeBSD 2.0.5-950622-SNAP #0: Wed Dec 31 02:26:08 CST 1997 bin@base486.home.org:/usr/src/sys/compile/base486 i386 Compiler: gcc 2.6.3 >Description: For whatever reason, I've got a GIF file named 'count.cgi.gif' which is being referenced by It fails to display (using Netscape, but this is probably immaterial). Apache's error log contains: [Sat Dec 12 00:08:09 1998] [error] [client 10.0.0.2] Premature end of script headers: /usr/local/apache/htdocs/mcs/html/ihsc/Count.cgi.gif If I rename the GIF to `count.gif' then it works >How-To-Repeat: http://www.mcs.net/~imdave/html/ihsc/index.html At the bottom of the page is the counter image >Fix: Well, I'd suspect that whatever is looking for a suffix of `.cgi' is not making sure that it's a suffix -- a match in the middle of the name shouldn't trigger anything, should it? >Audit-Trail: State-Changed-From-To: open-closed State-Changed-By: marc State-Changed-When: Fri Dec 11 22:41:54 PST 1998 State-Changed-Why: That is the way it is supposed to work. If you add a ".cgi" handler then it matches .cgi part anywhere in the URL. This is the way it is designed to work, although it can be a little unintuitive at times. If you setup your CGI scripts by setting .cgi to the proper mime type instead of using a handler, that would have the side effect of avoiding this. >Unformatted: [In order for any reply to be added to the PR database, ] [you need to include in the Cc line ] [and leave the subject line UNCHANGED. This is not done] [automatically because of the potential for mail loops. ] [If you do not include this Cc, your reply may be ig- ] [nored unless you are responding to an explicit request ] [from a developer. ] [Reply only with text; DO NOT SEND ATTACHMENTS! ]