git.shiar.nl
/
sheet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
74d5618
)
source: allow external website inclusion of json
author
Mischa POSLAWSKY
<perl@shiar.org>
Mon, 17 Aug 2020 16:40:04 +0000
(18:40 +0200)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Tue, 20 Oct 2020 20:49:11 +0000
(22:49 +0200)
Header to permit data being used in modern browsers.
source.plp
patch
|
blob
|
history
diff --git
a/source.plp
b/source.plp
index 5d445e5658f530539b79108238e0266b6a286a62..f49c8edeea7788e3e5974e857d25d87af5ca74f6 100644
(file)
--- a/
source.plp
+++ b/
source.plp
@@
-13,6
+13,7
@@
if ($source =~ s{(?<=\Q.inc.pl\E)/jsonp?$}{} and -r $source) {
$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);