latin: palm graffiti font placeholder
[sheet.git] / source.plp
index 269e342a2c331a31aa2cd3f6f82a13cae54b34a9..f49c8edeea7788e3e5974e857d25d87af5ca74f6 100644 (file)
@@ -10,9 +10,10 @@ if ($source =~ s{(?<=\Q.inc.pl\E)/jsonp?$}{} and -r $source) {
                my $data = do $source or die $@ || $! || 'read error';
                require JSON;
                my $converter = JSON->new;
-               $converter->utf8->indent->space_after->canonical;
+               $converter->indent->space_after->canonical;
 
                $header{content_type} = 'application/json';
+               $header{'Access-Control-Allow-Origin'} = '*';
                $header{content_type} = 'text/plain' if exists $get{debug};
                print $_, '(' for $get{callback} // ();
                print $converter->encode($data);
@@ -55,7 +56,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');