test: tighten media ssrf result assertion · openclaw/openclaw@db2cc57
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -85,9 +85,17 @@ describe("media understanding attachments SSRF", () => {
|
85 | 85 | ssrfPolicy: { allowRfc2544BenchmarkRange: true }, |
86 | 86 | }); |
87 | 87 | |
88 | | -await expect( |
89 | | -allowedCache.getBuffer({ attachmentIndex: 0, maxBytes: 1024, timeoutMs: 1000 }), |
90 | | -).resolves.toMatchObject({ mime: "image/jpeg" }); |
| 88 | +const result = await allowedCache.getBuffer({ |
| 89 | +attachmentIndex: 0, |
| 90 | +maxBytes: 1024, |
| 91 | +timeoutMs: 1000, |
| 92 | +}); |
| 93 | +expect(result).toStrictEqual({ |
| 94 | +buffer: Buffer.from("image"), |
| 95 | +mime: "image/jpeg", |
| 96 | +fileName: "file.jpg", |
| 97 | +size: 5, |
| 98 | +}); |
91 | 99 | expect(fetchSpy).toHaveBeenCalledTimes(1); |
92 | 100 | }); |
93 | 101 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。