1👍
I had this problem and fix using this module
https://github.com/Baroshem/nuxt-security
The documentation to solve your problem:
https://github.com/Baroshem/nuxt-security/blob/main/docs/content/1.getting-started/2.configuration.md
- [Vuejs]-Tooltip does not update on button click (Vue JS)
- [Vuejs]-Vue js non child parent communication with event bus does not work
0👍
If you set img-src
to []
(empty array), you are allowing everything. You can also be specific and set it to ["'self'", 'data:', 'https://www.example.com']
. Setting img-src
to undefined
(also a valid value) seems to give you the default settings, which are ["'self'", 'data:']
.
Your nuxt.config.ts
file could look like this:
export default defineNuxtConfig({
modules: [
'nuxt-security',
],
security: {
headers: {
contentSecurityPolicy: {
'img-src': ["'self'", 'data:', 'https://www.example.com'],
},
},
},
})
A couple of gotchas:
- This value works:
'https://www.example.com'
and this does not:'example.com'
- This value works:
"'self'"
and this does not:'self'
- [Vuejs]-Binding Vue.js to all instances of an element, without(?) using Components
- [Vuejs]-VueJS Datatable: How do I get all the rows selected?
Source:stackexchange.com