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

Unrecognized Content-Security-Policy directive 'undefined'. #307

Closed
marcaureln opened this issue Nov 29, 2023 · 3 comments · Fixed by #304 or #311
Closed

Unrecognized Content-Security-Policy directive 'undefined'. #307

marcaureln opened this issue Nov 29, 2023 · 3 comments · Fixed by #304 or #311
Labels
bug Something isn't working

Comments

@marcaureln
Copy link

Version

nuxt-security: 1.0.0-rc.4
nuxt: 3.7.4

Steps to reproduce

nuxt.config.ts

export default defineNuxtConfig({
  ...
  modules: ['nuxt-security'],
  security: {
    headers: {
      crossOriginOpenerPolicy: false,
      crossOriginEmbedderPolicy: false,
      contentSecurityPolicy: false,
    },
  },
...
});

What is Expected?

This warning shouldn't be printed in the browser console because contentSecurityPolicy is set to false.

What is actually happening?

Got: Unrecognized Content-Security-Policy directive 'undefined'. in browser console.

@marcaureln marcaureln added the bug Something isn't working label Nov 29, 2023
@vejja
Copy link
Collaborator

vejja commented Nov 29, 2023

@marcaureln You're right
Also related: #292

PR #304 will fix
For now you can set contentSecurityPolicy: '' to avoid the console warning

@marcaureln
Copy link
Author

Thanks @vejja !

The empty string didn't fix it. But tried ' ' (single space) and the warning vanish. Can't wait to use the upcoming release.

@Baroshem
Copy link
Owner

Baroshem commented Dec 2, 2023

@vejja Thanks guys for finding and solving it!

Aiming to release it with 1.0.0-rc.5 soon :)

@Baroshem Baroshem mentioned this issue Dec 5, 2023
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants