CGI: if the page is missing, give the "missing page" a 404 status
authorSimon McVittie <smcv@ http://smcv.pseudorandom.co.uk/>
Sat, 31 Jan 2009 16:51:13 +0000 (16:51 +0000)
committerSimon McVittie <smcv@ http://smcv.pseudorandom.co.uk/>
Sat, 31 Jan 2009 16:51:13 +0000 (16:51 +0000)
IkiWiki/CGI.pm

index f23d44fd6dd80a8707c78c9d74c39251a435bf9f..fe845726229137b8c623cb8fda86100785d82d07 100644 (file)
@@ -318,7 +318,7 @@ sub cgi_goto ($;$) {
        my $link = bestlink("", $page);
 
        if (! length $link) {
-               print "Content-type: text/html\n\n";
+               print $q->header(-status => "404 Not Found");
                print misctemplate(gettext("missing page"),
                        "<p>".
                        sprintf(gettext("The page %s does not exist."),