requestLimit
constrequestLimit: (config?) =>Policy
Defined in: src/policies/traffic/request-limit.ts:30
Reject requests whose declared Content-Length exceeds maxBytes.
This policy checks only the Content-Length header. If the header is
absent or invalid, the request passes through. Notably, requests using
chunked transfer encoding (Transfer-Encoding: chunked) do not include
a Content-Length header and will bypass this check entirely. For strict
body size enforcement, combine this policy with a body-reading policy
that enforces limits on the actual stream length.
Parameters
Section titled “Parameters”config?
Section titled “config?”Maximum byte limit and optional custom message.
Returns
Section titled “Returns”A Policy at priority 5 (EARLY).