From 989949aaa779a9c11f1a55c57ec34bad6857713b Mon Sep 17 00:00:00 2001 From: Tee Ming Date: Thu, 10 Oct 2024 18:04:23 +0800 Subject: [PATCH] docs: add report uri directive to CSP example (#12788) * add report uri directive to example * generate types * move line higher * the --- packages/kit/src/exports/public.d.ts | 4 +++- packages/kit/types/index.d.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/kit/src/exports/public.d.ts b/packages/kit/src/exports/public.d.ts index 20be682b053d..762843be53ce 100644 --- a/packages/kit/src/exports/public.d.ts +++ b/packages/kit/src/exports/public.d.ts @@ -332,8 +332,10 @@ export interface KitConfig { * directives: { * 'script-src': ['self'] * }, + * // must be specified with either the `report-uri` or `report-to` directives, or both * reportOnly: { - * 'script-src': ['self'] + * 'script-src': ['self'], + * 'report-uri': ['/'] * } * } * } diff --git a/packages/kit/types/index.d.ts b/packages/kit/types/index.d.ts index eaff35b7a026..3d0a17e951e3 100644 --- a/packages/kit/types/index.d.ts +++ b/packages/kit/types/index.d.ts @@ -314,8 +314,10 @@ declare module '@sveltejs/kit' { * directives: { * 'script-src': ['self'] * }, + * // must be specified with either the `report-uri` or `report-to` directives, or both * reportOnly: { - * 'script-src': ['self'] + * 'script-src': ['self'], + * 'report-uri': ['/'] * } * } * }