l radio news: remove duplicate CORS headers

This commit is contained in:
lassulus 2022-05-25 17:42:56 +02:00
parent 1c02415b6e
commit d9b09371ec

View File

@ -104,8 +104,6 @@ in
case "''${Method:-GET} $Request_URI" in case "''${Method:-GET} $Request_URI" in
"GET /") "GET /")
printf 'HTTP/1.1 200 OK\r\n' printf 'HTTP/1.1 200 OK\r\n'
printf 'Access-Control-Allow-Origin: *\r\n';
printf 'Access-Control-Allow-Methods: GET, POST, OPTIONS\r\n';
printf 'Connection: close\r\n' printf 'Connection: close\r\n'
printf '\r\n' printf '\r\n'
cat "$HOME"/news | jq -sc . cat "$HOME"/news | jq -sc .
@ -116,8 +114,6 @@ in
echo "$payload" | jq 'has("from") and has("to") and has("text")' >&2 echo "$payload" | jq 'has("from") and has("to") and has("text")' >&2
echo "$payload" | jq -c '{ from: (.from | fromdate | todate), to: (.to | fromdate | todate), text: .text }' >> "$HOME"/news echo "$payload" | jq -c '{ from: (.from | fromdate | todate), to: (.to | fromdate | todate), text: .text }' >> "$HOME"/news
printf 'HTTP/1.1 200 OK\r\n' printf 'HTTP/1.1 200 OK\r\n'
printf 'Access-Control-Allow-Origin: *\r\n';
printf 'Access-Control-Allow-Methods: GET, POST, OPTIONS\r\n';
printf 'Connection: close\r\n' printf 'Connection: close\r\n'
printf '\r\n' printf '\r\n'
exit exit