[]previous and next page

LimitsOptions

Limits applied before any application code runs.

Limits applied before any application code runs.

Import#

ts
import type { LimitsOptions } from "@shadow-js/dusk/server";

Signature#

ts
interface LimitsOptions {
  /** Longest accepted URL (`request.url`), in characters. Default 8192; longer gives 414. */
  readonly maxUrlLength?: number;
  /** Largest accepted request body in bytes. Default 1 MiB; larger gives 413. */
  readonly maxBodyBytes?: number;
  /**
   * The largest `maxBodyBytes` a route may ask for (`apiHandler({ maxBodyBytes })`). Default 512 MiB. A route value above it
   * is clamped to it; the ceiling is never below `maxBodyBytes`.
   */
  readonly maxRouteBodyBytes?: number;
  /**
   * Caps on the entries of a multipart or urlencoded form read with `readFormLimited`: fields, files, file size, text field
   * size and the total of text fields. Defaults: 1000 entries, 20 files, 10 MiB per file, 64 KiB per field, 1 MiB of fields.
   */
  readonly form?: Partial<FormLimits>;
  /** Time to produce the response head, in milliseconds. Default 30 000; longer gives 504. */
  readonly requestTimeoutMs?: number;
  /** Time a streamed page may take until its last byte, in milliseconds. Default 120 000. */
  readonly streamTimeoutMs?: number;
}

Members#

Name Type Description
maxUrlLength? readonly maxUrlLength?: number Longest accepted URL (request.url), in characters. Default 8192; longer gives 414.
maxBodyBytes? readonly maxBodyBytes?: number Largest accepted request body in bytes. Default 1 MiB; larger gives 413.
maxRouteBodyBytes? readonly maxRouteBodyBytes?: number The largest maxBodyBytes a route may ask for (apiHandler({ maxBodyBytes })). Default 512 MiB. A route value above it is clamped to it; the ceiling is never below maxBodyBytes.
form? readonly form?: Partial<FormLimits> Caps on the entries of a multipart or urlencoded form read with readFormLimited: fields, files, file size, text field size and the total of text fields. Defaults: 1000 entries, 20 files, 10 MiB per file, 64 KiB per field, 1 MiB of fields.
requestTimeoutMs? readonly requestTimeoutMs?: number Time to produce the response head, in milliseconds. Default 30 000; longer gives 504.
streamTimeoutMs? readonly streamTimeoutMs?: number Time a streamed page may take until its last byte, in milliseconds. Default 120 000.