source: delay header output until after errors
authorMischa POSLAWSKY <perl@shiar.org>
Sat, 21 Apr 2018 16:04:11 +0000 (18:04 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Thu, 10 May 2018 14:49:06 +0000 (16:49 +0200)
source.plp

index 269e342a2c331a31aa2cd3f6f82a13cae54b34a9..72fdf825e5bffbdc17996e60cfc21ec79e020f00 100644 (file)
@@ -55,7 +55,9 @@ if (not $source) {
 }
 else {
        my $href = showlink($source, $source =~ m{\A (\w+) \.plp \z}x && "/$1");
 }
 else {
        my $href = showlink($source, $source =~ m{\A (\w+) \.plp \z}x && "/$1");
-       say "<h1>Source of $href</h1>";
+       PLP_START {
+               say "<h1>Source of $href</h1>";
+       };
 
        if ($source =~ m{(?:/|^)\.}) {
                Abort("File request not permitted", '403 source not allowed');
 
        if ($source =~ m{(?:/|^)\.}) {
                Abort("File request not permitted", '403 source not allowed');