@sveltejs/adapter-node
Advanced tools
Comparing version 2.1.1 to 3.0.0
@@ -975,8 +975,12 @@ import 'SHIMS'; | ||
if (body_size_limit !== undefined && content_length > body_size_limit) { | ||
const error = new SvelteKitError( | ||
413, | ||
'Payload Too Large', | ||
`Content-length of ${content_length} exceeds limit of ${body_size_limit} bytes.` | ||
); | ||
let message = `Content-length of ${content_length} exceeds limit of ${body_size_limit} bytes.`; | ||
if (body_size_limit === 0) { | ||
// https://github.com/sveltejs/kit/pull/11589 | ||
// TODO this exists to aid migration — remove in a future version | ||
message += ' To disable body size limits, specify Infinity rather than 0.'; | ||
} | ||
const error = new SvelteKitError(413, 'Payload Too Large', message); | ||
controller.error(error); | ||
@@ -1138,4 +1142,10 @@ return; | ||
const port_header = env('PORT_HEADER', '').toLowerCase(); | ||
const body_size_limit = parseInt(env('BODY_SIZE_LIMIT', '524288')) || undefined; | ||
const body_size_limit = Number(env('BODY_SIZE_LIMIT', '524288')); | ||
if (isNaN(body_size_limit)) { | ||
throw new Error( | ||
`Invalid BODY_SIZE_LIMIT: '${env('BODY_SIZE_LIMIT')}'. Please provide a numeric value.` | ||
); | ||
} | ||
const dir = path.dirname(fileURLToPath(import.meta.url)); | ||
@@ -1142,0 +1152,0 @@ |
{ | ||
"name": "@sveltejs/adapter-node", | ||
"version": "2.1.1", | ||
"version": "3.0.0", | ||
"description": "Adapter for SvelteKit apps that generates a standalone Node server", | ||
@@ -35,3 +35,3 @@ "repository": { | ||
"vitest": "^1.0.4", | ||
"@sveltejs/kit": "^2.2.1" | ||
"@sveltejs/kit": "^2.3.0" | ||
}, | ||
@@ -38,0 +38,0 @@ "dependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
49573
1523