import { IHttpServerComponent } from '@dcl/core-commons'; /** * Creates a per-route middleware that rejects request bodies larger than `maxBodySize` bytes with * `413 Payload Too Large`. * * - A request that declares a larger `Content-Length` is rejected up front, before its body is read. * - A body that omits or under-declares its length (e.g. chunked transfer-encoding) is capped while * streaming: once a downstream handler reads past the limit the body errors, and the middleware * turns that into a `413` and closes the connection so the client can't keep streaming. * * Either way the `413` carries `Connection: close` so an oversized or stalled request can't tie up * the socket. * * Unlike the server-wide `maxBodySize` option (enforced at the transport layer for the whole * server), this middleware can be applied to individual routes for tighter, per-endpoint limits. * * @public */ export declare function createBodySizeLimitMiddleware(maxBodySize: number): IHttpServerComponent.IRequestHandler;