fix(media): strip internal UUID suffix from outbound media filenames · openclaw/openclaw@cf512f6
NarahariRagh
·
2026-06-25
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -573,6 +573,16 @@ describe("loadWebMedia", () => {
|
573 | 573 | expect(result.fileName).toBe("fake.png"); |
574 | 574 | }); |
575 | 575 | |
| 576 | +it("strips internal media-store UUID suffix from outbound fileName", async () => { |
| 577 | +const stagedName = "narahari_resume---a1b2c3d4-5678-90ab-cdef-1234567890ab.png"; |
| 578 | +const stagedFile = path.join(fixtureRoot, stagedName); |
| 579 | +await fs.writeFile(stagedFile, Buffer.from(TINY_PNG_BASE64, "base64")); |
| 580 | + |
| 581 | +const result = await loadWebMedia(stagedFile, createLocalWebMediaOptions()); |
| 582 | + |
| 583 | +expect(result.fileName).toBe("narahari_resume.png"); |
| 584 | +}); |
| 585 | + |
576 | 586 | it("uses only the leaf filename from Windows-style sandbox-validated media paths", async () => { |
577 | 587 | const result = await loadWebMedia(String.raw`C:\workspace\captures\tiny.png`, { |
578 | 588 | maxBytes: 1024 * 1024, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。