common: avoid contents on HEAD method for all pages
authorMischa POSLAWSKY <perl@shiar.org>
Mon, 30 Oct 2023 19:11:14 +0000 (20:11 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Tue, 31 Oct 2023 23:39:00 +0000 (00:39 +0100)
Support fast if-modified lookup everywhere why not.

common.inc.plp
index.plp

index 6ea11976106b6363bd8b0d88dfca1b267cae6476..f127505d71866bfb054b38b8ed36232194c3f6bd 100644 (file)
@@ -142,6 +142,7 @@ sub Html {
        # document headers before output
        $header{content_type} = "text/html; charset=$meta->{charset}"
                unless $PLP::sentheaders;
+       exit if $ENV{REQUEST_METHOD} eq 'HEAD';
        unshift @{ $meta->{raw} }, stylesheet($meta->{stylesheet});
 
        push @{ $meta->{raw} }, (
index 8d48cf79e7a5d03030f34f6041326e43dac6c58a..329620748a81bbb0eafa40510d3d72c150520729 100644 (file)
--- a/index.plp
+++ b/index.plp
@@ -17,8 +17,6 @@ Html({
        ],
        data => ['UPDATE'],
 });
-
-exit if $ENV{REQUEST_METHOD} eq 'HEAD';
 :>
 <h1>Shiar's cheat sheets</h1>