Compare commits

...
3 Commits
Author SHA1 Message Date
timi 359eac8985 Merge pull request 'v1.0.73' (#85) from dev into master
Reviewed-on: #85
2026-11-17 06:27:05 +00:00
Timi 96750730d3 v1.0.73
CI / build-deploy (pull_request) Successful in 34s
CI / notify-on-failure (pull_request) Skipped
2026-11-17 14:26:22 +08:00
Timi 725503152e fix(attach): lost file name for download 2026-11-17 14:26:09 +08:00
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -11,7 +11,7 @@
<groupId>com.imyeyu.timiserverapi</groupId>
<artifactId>TimiServerAPI</artifactId>
<version>1.0.72</version>
<version>1.0.73</version>
<packaging>jar</packaging>
<name>TimiServerAPI</name>
<description>imyeyu.com API</description>
@@ -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()));
}
}