/** * HTTP 工具 — 统一的请求体读取函数 * * 消除 server.ts 和 relay/server.ts 中的重复实现。 */ import type { IncomingMessage } from "node:http"; /** * 读取请求体为字符串(UTF-8) * * 安全特性: * - Content-Length 预检(拒绝 NaN/负数/超限) * - 流式大小检查(防绕过 Content-Length) * - 超时保护(防 Slowloris 慢速攻击) */ export declare function readBody(req: IncomingMessage, maxBytes?: number, timeoutMs?: number): Promise; /** * 读取请求体为 Buffer(用于文件上传等二进制场景) */ export declare function readBodyAsBuffer(req: IncomingMessage, maxBytes?: number, timeoutMs?: number): Promise; //# sourceMappingURL=http-utils.d.ts.map