Skip to content
5 changes: 5 additions & 0 deletions .changeset/mean-lines-roll.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

fix: support `ws:`/`wss:` and `trusted-types-eval` for CSP sources
14 changes: 13 additions & 1 deletion packages/kit/src/types/private.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ export namespace Csp {
| 'unsafe-eval'
| 'unsafe-hashes'
| 'unsafe-inline'
| 'unsafe-allow-redirects'
| 'unsafe-webtransport-hashes'
| 'wasm-unsafe-eval'
| 'trusted-types-eval'
| 'none';
type CryptoSource = `${'nonce' | 'sha256' | 'sha384' | 'sha512'}-${string}`;
type FrameSource = HostSource | SchemeSource | 'self' | 'none';
Expand All @@ -70,7 +73,16 @@ export namespace Csp {
type HostProtocolSchemes = `${string}://` | '';
type HttpDelineator = '/' | '?' | '#' | '\\';
type PortScheme = `:${number}` | '' | ':*';
type SchemeSource = 'http:' | 'https:' | 'data:' | 'mediastream:' | 'blob:' | 'filesystem:';
type SchemeSource =
| 'http:'
| 'https:'
| 'ws:'
| 'wss:'
| 'data:'
Comment thread
ThaUnknown marked this conversation as resolved.
| 'mediastream:'
| 'blob:'
| 'filesystem:'
| (`${string}:` & {});
type Source = HostSource | SchemeSource | CryptoSource | BaseSource;
type Sources = Source[];
}
Expand Down
14 changes: 13 additions & 1 deletion packages/kit/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2396,7 +2396,10 @@ declare module '@sveltejs/kit' {
| 'unsafe-eval'
| 'unsafe-hashes'
| 'unsafe-inline'
| 'unsafe-allow-redirects'
| 'unsafe-webtransport-hashes'
| 'wasm-unsafe-eval'
| 'trusted-types-eval'
| 'none';
type CryptoSource = `${'nonce' | 'sha256' | 'sha384' | 'sha512'}-${string}`;
type FrameSource = HostSource | SchemeSource | 'self' | 'none';
Expand All @@ -2405,7 +2408,16 @@ declare module '@sveltejs/kit' {
type HostProtocolSchemes = `${string}://` | '';
type HttpDelineator = '/' | '?' | '#' | '\\';
type PortScheme = `:${number}` | '' | ':*';
type SchemeSource = 'http:' | 'https:' | 'data:' | 'mediastream:' | 'blob:' | 'filesystem:';
type SchemeSource =
| 'http:'
| 'https:'
| 'ws:'
| 'wss:'
| 'data:'
| 'mediastream:'
| 'blob:'
| 'filesystem:'
| (`${string}:` & {});
type Source = HostSource | SchemeSource | CryptoSource | BaseSource;
type Sources = Source[];
}
Expand Down
Loading