mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-21 19:15:47 +00:00
test(feishu): accept native oversized body resets
This commit is contained in:
parent
4f2f5e0461
commit
7c6bf331b8
1 changed files with 11 additions and 3 deletions
|
|
@ -131,11 +131,15 @@ async function waitForOversizedBodyResponse(url: string): Promise<string> {
|
|||
finish(response);
|
||||
}
|
||||
});
|
||||
socket.on("error", (error) => {
|
||||
socket.on("error", (error: NodeJS.ErrnoException) => {
|
||||
if (response.includes("Payload too large")) {
|
||||
finish(response);
|
||||
return;
|
||||
}
|
||||
if (error.code === "ECONNRESET") {
|
||||
finish("ECONNRESET");
|
||||
return;
|
||||
}
|
||||
reject(error);
|
||||
});
|
||||
|
||||
|
|
@ -242,8 +246,12 @@ describe("Feishu webhook security hardening", () => {
|
|||
async (url) => {
|
||||
const response = await waitForOversizedBodyResponse(url);
|
||||
|
||||
expect(response).toContain("413 Payload Too Large");
|
||||
expect(response).toContain("Payload too large");
|
||||
if (response === "ECONNRESET") {
|
||||
expect(response).toBe("ECONNRESET");
|
||||
} else {
|
||||
expect(response).toContain("413 Payload Too Large");
|
||||
expect(response).toContain("Payload too large");
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue