Skip to content

Add cross-origin headers required for SABs#563

Open
netpro2k wants to merge 1 commit into
masterfrom
SAB-headers
Open

Add cross-origin headers required for SABs#563
netpro2k wants to merge 1 commit into
masterfrom
SAB-headers

Conversation

@netpro2k

Copy link
Copy Markdown
Contributor

Adds the required headers to load Hubs in a secure context to access SharedArrayBuffers and high resolution timers. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer#security_requirements. This also increases security in general, but will make it more difficult to communicate with iframed hubs clients if that becomes necessary in the future.

Reticulum compliment to Hubs-Foundation/hubs#4252

@rawnsley

Copy link
Copy Markdown

Related PR on the client side Hubs-Foundation/hubs#4555

@brianpeiris brianpeiris left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think there was a critical typo here.

Comment thread lib/ret_web/router.ex
plug(:put_secure_browser_headers)
plug(:put_secure_browser_headers, %{
"cross-origin-opener-policy" => "same-origin",
"cross-origin-resource-policy" => "require-corp"

Copy link
Copy Markdown
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"

Comment thread lib/ret_web/router.ex
plug(:put_secure_browser_headers)
plug(:put_secure_browser_headers, %{
"cross-origin-opener-policy" => "same-origin",
"cross-origin-resource-policy" => "require-corp"

Copy link
Copy Markdown
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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants