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

Conversation

netpro2k
Copy link
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

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

Copy link
Contributor

@brianpeiris brianpeiris left a comment

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.

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(: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"

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