Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Add access-control-allow-origin to script HTTP response

Uku Tahtadf9c1acfb20
diff --git a/lib/plausible_web/plugs/tracker.ex b/lib/plausible_web/plugs/tracker.ex
index 61a808e204..8252f04c41 100644
--- a/lib/plausible_web/plugs/tracker.ex
+++ b/lib/plausible_web/plugs/tracker.ex
@@ -63,6 +63,7 @@ defmodule PlausibleWeb.Tracker do
conn
|> put_resp_header("content-type", "application/javascript")
|> put_resp_header("cross-origin-resource-policy", "cross-origin")
+ |> put_resp_header("access-control-allow-origin", "*")
|> send_file(200, location)
|> halt()
end