security: add csp (#689)
This commit is contained in:
1 parent
6283bcecad
commit
b872db9eaf
1 file changed
+12
-2
+12
-2
@@ -1,8 +1,8 @@
|
|||||||
import node from '@sveltejs/adapter-node'
|
|
||||||
import bun from 'svelte-adapter-bun-next'
|
|
||||||
import auto from '@sveltejs/adapter-auto'
|
import auto from '@sveltejs/adapter-auto'
|
||||||
|
import node from '@sveltejs/adapter-node'
|
||||||
import staticAdapter from '@sveltejs/adapter-static'
|
import staticAdapter from '@sveltejs/adapter-static'
|
||||||
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'
|
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'
|
||||||
|
import bun from 'svelte-adapter-bun-next'
|
||||||
|
|
||||||
/** @type {import('@sveltejs/kit').Config} */
|
/** @type {import('@sveltejs/kit').Config} */
|
||||||
const config = {
|
const config = {
|
||||||
@@ -36,6 +36,16 @@ const config = {
|
|||||||
'svelte-hero-icons': 'node_modules/@xylightdev/svelte-hero-icons',
|
'svelte-hero-icons': 'node_modules/@xylightdev/svelte-hero-icons',
|
||||||
$comp: 'src/lib/components',
|
$comp: 'src/lib/components',
|
||||||
},
|
},
|
||||||
|
csp: {
|
||||||
|
directives: {
|
||||||
|
'script-src': ['self'],
|
||||||
|
},
|
||||||
|
// must be specified with either the `report-uri` or `report-to` directives, or both
|
||||||
|
reportOnly: {
|
||||||
|
'script-src': ['self'],
|
||||||
|
'report-uri': ['/'],
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user