From de9483933982b3526d4e47dc3dc723814295b66a Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Sun, 10 Jul 2016 15:26:44 +0100 Subject: [PATCH] Add a CORS header to data json files. --- debian/lighttpd/89-dump1090-fa.conf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/lighttpd/89-dump1090-fa.conf b/debian/lighttpd/89-dump1090-fa.conf index bfc84d6..f5d93fb 100644 --- a/debian/lighttpd/89-dump1090-fa.conf +++ b/debian/lighttpd/89-dump1090-fa.conf @@ -19,3 +19,9 @@ $SERVER["socket"] == ":8080" { url.redirect = ("^/(.*)" => "http://%1/dump1090-fa/$1") } } + +# Add CORS header +server.modules += ( "mod_setenv" ) +$HTTP["url"] =~ "^/dump1090-fa/data/.*\.json$" { + setenv.add-response-header = ( "Access-Control-Allow-Origin" => "*" ) +}