mirror of
https://github.com/plausible/analytics.git
synced 2024-12-24 18:12:44 +03:00
Add Cross-Origin-Resource-Policy header to script
Hey Plausible devs, I am trying to embed the `plausible.js` onto a page that has the [`require-corp`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Embedder-Policy) header set, which means that for every resource that is loaded they must be clearly marked as cross-origin OK. The tracker script response currently doesn't have that header set, so I can't load it right now. This would solve that.
This commit is contained in:
parent
6cd963ab35
commit
2b1dcd99d3
@ -47,6 +47,7 @@ defmodule PlausibleWeb.Tracker do
|
||||
conn
|
||||
|> put_resp_header("cache-control", "max-age=#{@max_age},public")
|
||||
|> put_resp_header("content-type", "application/javascript")
|
||||
|> put_resp_header("cross-origin-resource-policy", "cross-origin")
|
||||
|> send_resp(200, file)
|
||||
|> halt()
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user