Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cross-origin headers required for SABs #563

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions lib/ret_web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,20 @@ defmodule RetWeb.Router do
use Sentry.Plug

pipeline :secure_headers do
plug(:put_secure_browser_headers)
plug(:put_secure_browser_headers, %{
"cross-origin-opener-policy" => "same-origin",
"cross-origin-resource-policy" => "require-corp"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure this is wrong, and you actually meant to use the embedder-policy header, not the resource-policy header.

Suggested change
"cross-origin-resource-policy" => "require-corp"
"cross-origin-embedder-policy" => "require-corp"

})

plug(RetWeb.Plugs.AddCSP)
end

pipeline :strict_secure_headers do
plug(:put_secure_browser_headers)
plug(:put_secure_browser_headers, %{
"cross-origin-opener-policy" => "same-origin",
"cross-origin-resource-policy" => "require-corp"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"cross-origin-resource-policy" => "require-corp"
"cross-origin-embedder-policy" => "require-corp"

})

plug(RetWeb.Plugs.AddCSP, strict: true)
end

Expand Down