X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/917ba679115b9e3cd7b88f7e5081a1a2503a684e..d9ec472869a2c33c469cad90a21b221f14f29af3:/source.plp diff --git a/source.plp b/source.plp index 269e342..f49c8ed 100644 --- a/source.plp +++ b/source.plp @@ -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 "

Source of $href

"; + PLP_START { + say "

Source of $href

"; + }; if ($source =~ m{(?:/|^)\.}) { Abort("File request not permitted", '403 source not allowed');