source: delay header output until after errors
[sheet.git] / 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");
-       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');