@sveltejs/kit 2.36.0 → 2.36.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/core/config/options.js +7 -2
- package/src/core/sync/write_server.js +1 -1
- package/src/exports/public.d.ts +4 -1
- package/src/runtime/client/client.js +4 -1
- package/src/runtime/server/utils.js +3 -3
- package/src/version.js +1 -1
- package/types/index.d.ts +4 -1
- package/types/index.d.ts.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sveltejs/kit",
|
|
3
|
-
"version": "2.36.
|
|
3
|
+
"version": "2.36.2",
|
|
4
4
|
"description": "SvelteKit is the fastest way to build Svelte apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"framework",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"svelte-preprocess": "^6.0.0",
|
|
46
46
|
"typescript": "^5.3.3",
|
|
47
47
|
"vite": "^6.3.5",
|
|
48
|
-
"vitest": "^3.2.
|
|
48
|
+
"vitest": "^3.2.4"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"@sveltejs/vite-plugin-svelte": "^3.0.0 || ^4.0.0-next.1 || ^5.0.0 || ^6.0.0-next.0",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import process from 'node:process';
|
|
2
|
+
import colors from 'kleur';
|
|
2
3
|
|
|
3
4
|
/** @typedef {import('./types.js').Validator} Validator */
|
|
4
5
|
|
|
@@ -108,7 +109,11 @@ const options = object(
|
|
|
108
109
|
}),
|
|
109
110
|
|
|
110
111
|
csrf: object({
|
|
111
|
-
checkOrigin:
|
|
112
|
+
checkOrigin: deprecate(
|
|
113
|
+
boolean(true),
|
|
114
|
+
(keypath) =>
|
|
115
|
+
`\`${keypath}\` has been deprecated in favour of \`csrf.trustedOrigins\`. It will be removed in a future version`
|
|
116
|
+
),
|
|
112
117
|
trustedOrigins: string_array([])
|
|
113
118
|
}),
|
|
114
119
|
|
|
@@ -323,7 +328,7 @@ function deprecate(
|
|
|
323
328
|
) {
|
|
324
329
|
return (input, keypath) => {
|
|
325
330
|
if (input !== undefined) {
|
|
326
|
-
console.warn(get_message(keypath));
|
|
331
|
+
console.warn(colors.bold().yellow(get_message(keypath)));
|
|
327
332
|
}
|
|
328
333
|
|
|
329
334
|
return fn(input, keypath);
|
|
@@ -37,7 +37,7 @@ import { set_private_env, set_public_env } from '${runtime_directory}/shared-ser
|
|
|
37
37
|
export const options = {
|
|
38
38
|
app_template_contains_nonce: ${template.includes('%sveltekit.nonce%')},
|
|
39
39
|
csp: ${s(config.kit.csp)},
|
|
40
|
-
csrf_check_origin: ${s(config.kit.csrf.checkOrigin)},
|
|
40
|
+
csrf_check_origin: ${s(config.kit.csrf.checkOrigin && !config.kit.csrf.trustedOrigins.includes('*'))},
|
|
41
41
|
csrf_trusted_origins: ${s(config.kit.csrf.trustedOrigins)},
|
|
42
42
|
embedded: ${config.kit.embedded},
|
|
43
43
|
env_public_prefix: '${config.kit.env.publicPrefix}',
|
package/src/exports/public.d.ts
CHANGED
|
@@ -426,14 +426,17 @@ export interface KitConfig {
|
|
|
426
426
|
*
|
|
427
427
|
* To allow people to make `POST`, `PUT`, `PATCH`, or `DELETE` requests with a `Content-Type` of `application/x-www-form-urlencoded`, `multipart/form-data`, or `text/plain` to your app from other origins, you will need to disable this option. Be careful!
|
|
428
428
|
* @default true
|
|
429
|
+
* @deprecated Use `trustedOrigins: ['*']` instead
|
|
429
430
|
*/
|
|
430
431
|
checkOrigin?: boolean;
|
|
431
432
|
/**
|
|
432
|
-
* An array of origins that are allowed to make cross-origin form submissions to your app
|
|
433
|
+
* An array of origins that are allowed to make cross-origin form submissions to your app.
|
|
433
434
|
*
|
|
434
435
|
* Each origin should be a complete origin including protocol (e.g., `https://payment-gateway.com`).
|
|
435
436
|
* This is useful for allowing trusted third-party services like payment gateways or authentication providers to submit forms to your app.
|
|
436
437
|
*
|
|
438
|
+
* If the array contains `'*'`, all origins will be trusted. This is generally not recommended!
|
|
439
|
+
*
|
|
437
440
|
* **Warning**: Only add origins you completely trust, as this bypasses CSRF protection for those origins.
|
|
438
441
|
* @default []
|
|
439
442
|
* @example ['https://checkout.stripe.com', 'https://accounts.google.com']
|
|
@@ -185,7 +185,10 @@ let target;
|
|
|
185
185
|
export let app;
|
|
186
186
|
|
|
187
187
|
/** @type {Record<string, any>} */
|
|
188
|
-
|
|
188
|
+
// we have to conditionally access the properties of `__SVELTEKIT_PAYLOAD__`
|
|
189
|
+
// because it will be `undefined` when users import the exports from this module.
|
|
190
|
+
// It's only defined when the server renders a page.
|
|
191
|
+
export const remote_responses = __SVELTEKIT_PAYLOAD__?.data ?? {};
|
|
189
192
|
|
|
190
193
|
/** @type {Array<((url: URL) => boolean)>} */
|
|
191
194
|
const invalidated = [];
|
|
@@ -194,13 +194,13 @@ export function has_prerendered_path(manifest, pathname) {
|
|
|
194
194
|
* @param {import('@sveltejs/kit').RequestEvent} event
|
|
195
195
|
*/
|
|
196
196
|
export function format_server_error(status, error, event) {
|
|
197
|
-
const formatted_text = `\n\x1b[1;31m[${status}] ${event.request.method} ${event.url.pathname}\x1b[0m
|
|
197
|
+
const formatted_text = `\n\x1b[1;31m[${status}] ${event.request.method} ${event.url.pathname}\x1b[0m`;
|
|
198
198
|
|
|
199
199
|
if (status === 404) {
|
|
200
|
-
return formatted_text
|
|
200
|
+
return formatted_text;
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
return formatted_text
|
|
203
|
+
return `${formatted_text}\n${DEV ? clean_up_stack_trace(error) : error.stack}`;
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
/**
|
package/src/version.js
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -402,14 +402,17 @@ declare module '@sveltejs/kit' {
|
|
|
402
402
|
*
|
|
403
403
|
* To allow people to make `POST`, `PUT`, `PATCH`, or `DELETE` requests with a `Content-Type` of `application/x-www-form-urlencoded`, `multipart/form-data`, or `text/plain` to your app from other origins, you will need to disable this option. Be careful!
|
|
404
404
|
* @default true
|
|
405
|
+
* @deprecated Use `trustedOrigins: ['*']` instead
|
|
405
406
|
*/
|
|
406
407
|
checkOrigin?: boolean;
|
|
407
408
|
/**
|
|
408
|
-
* An array of origins that are allowed to make cross-origin form submissions to your app
|
|
409
|
+
* An array of origins that are allowed to make cross-origin form submissions to your app.
|
|
409
410
|
*
|
|
410
411
|
* Each origin should be a complete origin including protocol (e.g., `https://payment-gateway.com`).
|
|
411
412
|
* This is useful for allowing trusted third-party services like payment gateways or authentication providers to submit forms to your app.
|
|
412
413
|
*
|
|
414
|
+
* If the array contains `'*'`, all origins will be trusted. This is generally not recommended!
|
|
415
|
+
*
|
|
413
416
|
* **Warning**: Only add origins you completely trust, as this bypasses CSRF protection for those origins.
|
|
414
417
|
* @default []
|
|
415
418
|
* @example ['https://checkout.stripe.com', 'https://accounts.google.com']
|
package/types/index.d.ts.map
CHANGED
|
@@ -187,6 +187,6 @@
|
|
|
187
187
|
null,
|
|
188
188
|
null
|
|
189
189
|
],
|
|
190
|
-
"mappings": ";;;;;;;;;;;kBAkCiBA,OAAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAiCZC,cAAcA;;;;;;aAMdC,cAAcA;;;;;;;;MAQrBC,aAAaA;;;;;OAKJC,YAAYA;;kBAETC,aAAaA;;;;;;MAMzBC,qBAAqBA;;;;;;;;;;;kBAWTC,OAAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA8IPC,MAAMA;;;;;;;;;;;kBAWNC,OAAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA4DPC,QAAQA;;;;;;;;kB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