in reply to Re^4: How to send a "true" 404 error via Perl
in thread How to send a "true" 404 error via Perl

That log entry is not for my script, since my script doesn't send 372 bytes of content.
  • Comment on Re^5: How to send a "true" 404 error via Perl

Replies are listed 'Best First'.
Re^6: How to send a "true" 404 error via Perl
by lokiloki (Beadle) on Jan 17, 2007 at 23:20 UTC
    Well, don't know what to say, but it is your script...
    [server]$ cat test.cgi #!/usr/bin/perl print "Status: 404 Not Found\n"; print "Content-Type: text/html\n"; print "\n"; print "<title>404 Not Found</title>\n"; print "<h1>404 Not Found</h1>\n"; [server]$
      Is your error handler still on? Maybe it's returning 200 and those 372 bytes. What are those 372 bytes anyway? (i.e. What do you see in your browser?) My script generates 52 bytes of content, not 372 bytes, so something else is changing or overriding my script's output.
        The only content in the browser is:

        <title>404 Not Found</title> <h1>404 Not Found</h1>

        When I use web-sniffer.net I get the following HTTP Response Header:

        HTTP Status Code: HTTP/1.1 404 Not Found Date: Wed, 17 Jan 2007 23:28:45 GMT CRLF Server: Apache/1.3.37 (Unix) mod_throttle/3.1.2 DAV/1.0.3 mod_fastc +gi/2.4.2 mod_gzip/1.3.26.1a PHP/4.4.4 mod_ssl/2.8.22 OpenSSL/0.9.7e + CRLF Connection: close CRLF Transfer-Encoding: chunked CRLF Content-Type: text/html CRLF

        So I guess, even though my log is still showing 200, that it is a "valid" 404 error?