From c89e3b9e9e2c02c722ffab40a8c1d4fcb5b92652 Mon Sep 17 00:00:00 2001 From: Ian Renton Date: Sun, 26 Jul 2020 09:27:02 +0100 Subject: [PATCH] Use set-response-header instead of add-response-header When accessing Dump 1090 JSON from another web server, I found that the "Access-Control-Allow-Origin" parameter was set twice ("*, *") which Chrome objected to. By changing "add-response-header" to "set-response-header" we ensure that the correct header is sent, but never duplicated. --- debian/lighttpd/89-dump1090-fa.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/lighttpd/89-dump1090-fa.conf b/debian/lighttpd/89-dump1090-fa.conf index 287fd4f..2f54026 100644 --- a/debian/lighttpd/89-dump1090-fa.conf +++ b/debian/lighttpd/89-dump1090-fa.conf @@ -23,5 +23,5 @@ $SERVER["socket"] == ":8080" { # Add CORS header server.modules += ( "mod_setenv" ) $HTTP["url"] =~ "^/dump1090-fa/data/.*\.json$" { - setenv.add-response-header = ( "Access-Control-Allow-Origin" => "*" ) + setenv.set-response-header = ( "Access-Control-Allow-Origin" => "*" ) }