httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Colm MacCárthaigh <colmm...@Redbrick.DCU.IE>
Subject Re: bug in mod_cgi (sends 200 instead of 500)
Date Fri, 17 Jan 2003 09:14:17 GMT
On Fri, Jan 17, 2003 at 04:36:58PM +1100, Stas Bekman wrote:
> Consider this mod_cgi script:
> 
> #!/usr/bin/perl -w
> print "Content-type: text/plain\n\n";
> print no_such_func();
> print "Shouldn't be printed";
> 
> httpd.conf:
> ScriptAlias /cgi-bin/ "/home/httpd/2.0/perl/"
> 
> The error is correctly logged:
> 
> [Fri Jan 17 16:31:03 2003] [error] [client 127.0.0.1] Undefined subroutine 
> &main::no_such_func called at /home/httpd/2.0/perl/500.pl line 6.
> 
> Though the client gets the response code 200!

That's correct behaviour :) If the CGI outputs valid headers and a blank
newline, then it's considered valid. Any subsequent errors or return
status within the CGI have no effect.

-- 
colmmacc@redbrick.dcu.ie        PubKey: colmmacc+pgp@redbrick.dcu.ie  
Web:                                 http://devnull.redbrick.dcu.ie/ 

Mime
View raw message