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.
This commit is contained in:
Ian Renton 2020-07-26 09:27:02 +01:00 committed by GitHub
parent d6b8065c3b
commit c89e3b9e9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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" => "*" )
}