Setu-TS
    Preparing search index...

    Interface HttpAdapterOptions

    Options every IHttpAdapter implementation in this package accepts, supplied by RuntimePlugin when it constructs one.

    They are grouped into an object rather than appended as another positional parameter because the four adapters already take different leading arguments (an injected serve host, a ws module, a WebSocket host), so a positional addition would sit at a different index in each.

    0.5.0

    interface HttpAdapterOptions {
        maxBodyBytes?: number;
        reportError?: (record: Readonly<Record<string, unknown>>) => void;
    }
    Index
    maxBodyBytes?: number

    Maximum request-body size, in bytes, enforced where the body is actually read. Omitted, the read is unbounded — the released behaviour.

    This is the layer a request header cannot switch off. HttpSecurityPlugin({ requestSize: { maxBodySize } }) refuses on a declared Content-Length before anything is read, which is cheaper and reports earlier; a chunked request declares no length, so only the read itself can bound it. Set both, and set this one to the same value or higher.

    0.5.0

    reportError?: (record: Readonly<Record<string, unknown>>) => void

    Last-resort sink for a server-side fault the adapter cannot answer with a response. Supplied by RuntimePlugin, which resolves it at call time: the registered logger when there is one, else IRuntimeServices.reportError. Omitted, the adapter stays silent.

    The record is already sanitized by the caller — a serializeError spread, with no request data — so a sink that writes it verbatim cannot leak a request payload.

    Type Declaration

      • (record: Readonly<Record<string, unknown>>): void
      • Parameters

        • record: Readonly<Record<string, unknown>>

          The already sanitized diagnostic

        Returns void

    0.10.0