Received: (qmail 70379 invoked by uid 501); 23 Feb 2001 18:44:14 -0000 Message-Id: <20010223184414.70378.qmail@apache.org> Date: 23 Feb 2001 18:44:14 -0000 From: Darcy Buskermolen Reply-To: darcy@wavefire.com To: submit@bugz.apache.org Subject: non standard conforming X-Send-Pr-Version: 3.110 >Number: 7304 >Category: mod_cgi >Synopsis: non standard conforming >Confidential: no >Severity: critical >Priority: medium >Responsible: apache >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: apache >Arrival-Date: Fri Feb 23 10:50:00 PST 2001 >Closed-Date: >Last-Modified: Thu Mar 14 19:10:00 PST 2002 >Originator: darcy@wavefire.com >Release: 1.3.x >Organization: apache >Environment: All/Any >Description: According to the CGI 1.1 specification, the server should parse the following 3 server headers, Content-type: Location: Status: Status apears not to be parsed in the correct manor. If the cgi sends a printf("Status: 404 Not Found\n\n"); the server should treat it as a 404, and call the ErrorDocument 404 handler. This however does not happen. >How-To-Repeat: Use the following C source: #include #include int main() { printf("Status: 404 Not Found\n\n"); exit(1); }; compile and place in a "cgi directory" telnet server port GET /cgi-bin/test HTTP/1.0 you will see a 0 lengthe document with a Content-type: plain/html >Fix: >Release-Note: >Audit-Trail: From: Darcy Buskermolen To: darcy@wavefire.com Cc: apbugs@apache.org Subject: mod_cgi/7304 Date: Thu, 14 Mar 2002 19:03:43 -0800 (PST) The problem reported over a year ago still exists, here is a working patch against 1.3.23 ---->8 snip *** mod_cgi.orig Thu Mar 14 18:54:56 2002 --- mod_cgi.c Thu Mar 14 18:44:23 2002 *************** static int cgi_handler(request_rec *r) *** 567,573 **** */ return REDIRECT; } ! ap_send_http_header(r); if (!r->header_only) { ap_send_fb(script_in, r); --- 567,576 ---- */ return REDIRECT; } ! else if ( r->status != 200 ) ! { ! return r->status; ! } ap_send_http_header(r); if (!r->header_only) { ap_send_fb(script_in, r); 8<--------- end snip I'm not sure if this ends up being the best way to handel this however it does work for me. >Unformatted: [In order for any reply to be added to the PR database, you need] [to include in the Cc line and make sure the] [subject line starts with the report component and number, with ] [or without any 'Re:' prefixes (such as "general/1098:" or ] ["Re: general/1098:"). If the subject doesn't match this ] [pattern, your message will be misfiled and ignored. The ] ["apbugs" address is not added to the Cc line of messages from ] [the database 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! ]