security: add csp (#689)

This commit is contained in:
xylight authored and GitHub committed 2025-11-20 06:09:02 +00:00
1 parent 6283bcecad
commit b872db9eaf
1 file changed
+12 -2
+12 -2
View File
@@ -1,8 +1,8 @@
import node from '@sveltejs/adapter-node'
import bun from 'svelte-adapter-bun-next'
import auto from '@sveltejs/adapter-auto'
import node from '@sveltejs/adapter-node'
import staticAdapter from '@sveltejs/adapter-static'
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'
import bun from 'svelte-adapter-bun-next'
/** @type {import('@sveltejs/kit').Config} */
const config = {
@@ -36,6 +36,16 @@ const config = {
'svelte-hero-icons': 'node_modules/@xylightdev/svelte-hero-icons',
$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': ['/'],
},
},
},
}