Files
bunext/dist/utils/read-request-body.d.ts
T
2026-10-13 15:52:34 +01:00

16 lines
522 B
TypeScript

export declare class RequestBodyTooLargeError extends Error {
status: number;
constructor(max_bytes: number);
}
type Params = {
req: Request;
max_bytes: number;
};
/**
* Reads the whole request body, aborting as soon as it grows past
* `max_bytes` so oversized (or chunked, length-less) bodies are never fully
* buffered. Returns `undefined` when the request has no body.
*/
export default function readRequestBody({ req, max_bytes, }: Params): Promise<Uint8Array<ArrayBuffer> | undefined>;
export {};