修复报销附件上传与中文文件名(07-28-travel-reimbursement-guide)

这个提交包含在:
2026-07-30 14:41:08 +08:00
父节点 531d2846a6
当前提交 734153847b
共修改 15 个文件,包含 434 行新增和 65 行删除
@@ -542,4 +542,13 @@ describe("purchase attachment storage and response helpers", () => {
expect(header).not.toContain("\\quote");
expect(header).toContain("filename*=UTF-8''");
});
it("supports safe inline Content-Disposition without changing the default", () => {
const header = buildAttachmentContentDisposition("铁路电子客票.pdf", { disposition: "inline" });
expect(header).toBe(
"inline; filename=\"attachment.pdf\"; filename*=UTF-8''%E9%93%81%E8%B7%AF%E7%94%B5%E5%AD%90%E5%AE%A2%E7%A5%A8.pdf",
);
expect(() => buildAttachmentContentDisposition("file.pdf", { disposition: "preview" })).toThrow(TypeError);
});
});