Skip to content

NetstringDecoderOptions

Defined in: packages/format-netstring/src/netstring/netstring-decoder.ts:23

Construction options for the netstring decoding half.

optional maxPayloadLength?: number

Defined in: packages/format-netstring/src/netstring/netstring-decoder.ts:34

Maximum declared payload length, in bytes.

A netstring announces its own length before sending any of it, so this limit is checked against the declaration rather than against bytes received. That lets a hostile 999999999999: be rejected immediately instead of after the receive buffer fills.

Defaults to 1 MiB.