修复报销附件上传与中文文件名(07-28-travel-reimbursement-guide)
这个提交包含在:
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
在新工单中引用
屏蔽一个用户