From 725503152e16e41a0e875e61402928e9f490b586 Mon Sep 17 00:00:00 2001 From: Timi Date: Tue, 17 Nov 2026 14:26:09 +0800 Subject: [PATCH 1/2] fix(attach): lost file name for download --- .../api/modules/common/controller/AttachmentController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/imyeyu/api/modules/common/controller/AttachmentController.java b/src/main/java/com/imyeyu/api/modules/common/controller/AttachmentController.java index a98e1b7..f398da6 100644 --- a/src/main/java/com/imyeyu/api/modules/common/controller/AttachmentController.java +++ b/src/main/java/com/imyeyu/api/modules/common/controller/AttachmentController.java @@ -260,7 +260,9 @@ public class AttachmentController { } private void setDownloadHeader(Attachment attachment) throws UnsupportedEncodingException { - if (attachment != null && TimiSpring.getRequest().getRequestURI().endsWith("/download") && attachment.getName() != null) { + // 路径带 /download 就强制下载:/download/{id} 的结尾是 id,用 endsWith 匹配不到 + boolean download = TimiSpring.getRequest().getRequestURI().contains("/download"); + if (attachment != null && download && attachment.getName() != null) { TimiSpring.getResponse().setHeader("Content-Disposition", Network.getFileDownloadHeader(attachment.getName())); } } -- 2.54.0 From 96750730d3da08fb31e47fda119d87096c3de80a Mon Sep 17 00:00:00 2001 From: Timi Date: Tue, 17 Nov 2026 14:26:22 +0800 Subject: [PATCH 2/2] v1.0.73 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8ae00d3..5c72108 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ com.imyeyu.timiserverapi TimiServerAPI - 1.0.72 + 1.0.73 jar TimiServerAPI imyeyu.com API -- 2.54.0