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

Stop setting Cross-Origin-Embedder-Policy by default in next major version #411

Closed
EvanHahn opened this issue Mar 28, 2023 · 8 comments
Closed
Assignees
Milestone

Comments

@EvanHahn
Copy link
Member

This has caused lots of problems for people.

The middleware should still be there, but it should be disabled by default.

@EvanHahn EvanHahn added this to the v7.0.0 milestone Mar 28, 2023
@EvanHahn EvanHahn self-assigned this Apr 8, 2023
EvanHahn added a commit that referenced this issue Apr 8, 2023
EvanHahn added a commit that referenced this issue Apr 9, 2023
@EvanHahn
Copy link
Member Author

EvanHahn commented Apr 9, 2023

This is done in the v7 branch. See #412.

EvanHahn added a commit that referenced this issue Apr 10, 2023
EvanHahn added a commit that referenced this issue May 6, 2023
EvanHahn added a commit that referenced this issue May 6, 2023
@EvanHahn
Copy link
Member Author

EvanHahn commented May 6, 2023

Merged in 61357a5.

@EvanHahn EvanHahn closed this as completed May 6, 2023
@stfsy
Copy link

stfsy commented May 7, 2023

@EvanHahn Curious what kind of problem it has caused, if you are available to elaborate in a few sentences

@EvanHahn
Copy link
Member Author

EvanHahn commented May 7, 2023

Good question.

Many users (especially those on Stack Overflow) had a lot of trouble with this header because of the way they were loading cross-origin resources. Helmet is supposed to be easy-to-use and this was causing a lot of trouble for a lot of people, which is why I changed the default.

@stfsy
Copy link

stfsy commented May 7, 2023

@EvanHahn understood, thank you

@lorand-horvath
Copy link

@stfsy It's great you've brought this up. I've had my fair share of issues with COEP, specifically having Helmet 5 & 6 setting the Cross-Origin-Embedder-Policy header to require-corp by default. This blocked cross-origin embedded iframes in my case and couldn't figure out what the issue was until I stumbled on @EvanHahn 's explanation on SO https://stackoverflow.com/questions/70752770/helmet-express-err-blocked-by-response-notsameorigin-200

The following solved the issue relatively painlessly:

app.use(
  helmet({
    crossOriginEmbedderPolicy: false
  })
);

Helmet 7 comes with COEP disabled out of the box.

@PulastTiwari
Copy link

@EvanHahn could you elaborate how to disable the COEP for .html files. I couldn't find resources to assist me in this. I referred and got to know about the issue from here https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Embedder-Policy

It's showing as default in VScode

Screenshot 2023-12-09 at 1 41 03 PM

@EvanHahn
Copy link
Member Author

EvanHahn commented Dec 9, 2023

@PulastTiwari Could you please open a new issue to discuss this? Please include your Helmet configuration, too—it will make it easier to answer your question.

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

No branches or pull requests

4 participants