16 lines
522 B
TypeScript
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 {};
|