mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-12 19:32:57 +00:00
fix(tooling): cancel oversized audit responses
This commit is contained in:
@@ -729,6 +729,7 @@ async function withBulkAdvisoryTimeout({ label, timeoutMs, run }) {
|
||||
async function readBoundedResponseText(response, maxBytes, label) {
|
||||
const contentLength = Number.parseInt(response.headers?.get?.("content-length") ?? "", 10);
|
||||
if (Number.isFinite(contentLength) && contentLength > maxBytes) {
|
||||
await response.body?.cancel().catch(() => undefined);
|
||||
throw Object.assign(new Error(`${label} exceeded ${maxBytes} bytes`), { code: "ETOOBIG" });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user