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

[Feature]: Content Security Policy Middleware #6668

Closed
kirillbashtenko opened this issue Dec 25, 2024 · 2 comments
Closed

[Feature]: Content Security Policy Middleware #6668

kirillbashtenko opened this issue Dec 25, 2024 · 2 comments

Comments

@kirillbashtenko
Copy link
Contributor

What problem does this feature solve?

Hi, is it possible to have something like https://nextjs.org/docs/app/building-your-application/configuring/content-security-policy ?
I tried to do so using Middleware or UnstableMiddleware but it seems not possible since static resources not passed through them...
Thank you

What does the proposed API look like?

Something like this should be good https://nextjs.org/docs/app/building-your-application/configuring/content-security-policy :)

@zllkjc
Copy link
Member

zllkjc commented Jan 20, 2025

I think you just want set header in middleware ?

@kirillbashtenko
Copy link
Contributor Author

@zllkjc Yeah, I think my original assumption was wrong, I wanted these headers on ALL files but it seems it's enough to set Content-Security-Policy to an HTML file to make things work. So UnstableMiddleware does the trick!

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

No branches or pull requests

2 participants