From b8db9b1a8deba4763a2a8a19ae0d0b7faf1f6ac9 Mon Sep 17 00:00:00 2001 From: Looly Date: Thu, 27 Jun 2024 11:58:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DgetFileNameFromDisposition?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=A4=B4=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 ++- hutool-http/src/main/java/cn/hutool/http/HttpResponse.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 787ce7868..248aa45c3 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ # 🚀Changelog ------------------------------------------------------------------------------------------------------------- -# 5.8.29(2024-06-21) +# 5.8.29(2024-06-27) ### 🐣新特性 * 【core 】 DateUtil增加offsetYear方法 @@ -24,6 +24,7 @@ * 【db 】 修复PooledConnection可能的数据库驱动未找到问题(issue#IA6EUQ@Gitee) * 【http 】 修复Mac下的微信浏览器被识别为移动端问题(issue#IA74K2@Gitee) * 【core 】 修复Tailer指定初始读取行数的计算错误问题(issue#IA77ML@Gitee) +* 【http 】 修复getFileNameFromDisposition获取头错误问题(issue#3632@Github) ------------------------------------------------------------------------------------------------------------- # 5.8.28(2024-05-29) diff --git a/hutool-http/src/main/java/cn/hutool/http/HttpResponse.java b/hutool-http/src/main/java/cn/hutool/http/HttpResponse.java index 74898f2c2..de1872d7c 100755 --- a/hutool-http/src/main/java/cn/hutool/http/HttpResponse.java +++ b/hutool-http/src/main/java/cn/hutool/http/HttpResponse.java @@ -489,7 +489,7 @@ public class HttpResponse extends HttpBase implements Closeable { */ public String getFileNameFromDisposition(String paramName) { paramName = ObjUtil.defaultIfNull(paramName, "filename"); - final List dispositions = headerList(Header.CONTENT_DISPOSITION.name()); + final List dispositions = headerList(Header.CONTENT_DISPOSITION.getValue()); String fileName = null; if (CollUtil.isNotEmpty(dispositions)) {