mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
change code
This commit is contained in:
parent
449e748f62
commit
c85f204da9
@ -3,7 +3,7 @@
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
# 5.7.17 (2021-11-24)
|
||||
# 5.7.17 (2021-11-26)
|
||||
|
||||
### 🐣新特性
|
||||
* 【core 】 增加AsyncUtil(pr#457@Gitee)
|
||||
@ -25,6 +25,7 @@
|
||||
* 【db 】 Db.executeBatch标记一个重载为弃用(issue#I4JIPH@Gitee)
|
||||
* 【core 】 增加CharSequenceUtil.subPreGbk重载(issue#I4JO2E@Gitee)
|
||||
* 【core 】 ReflectUtil.getMethod排除桥接方法(pr#1965@Github)
|
||||
* 【http 】 completeFileNameFromHeader在使用path为路径时,自动解码(issue#I4K0FS@Gitee)
|
||||
*
|
||||
### 🐞Bug修复
|
||||
* 【core 】 修复FileResource构造fileName参数无效问题(issue#1942@Github)
|
||||
|
@ -7,7 +7,6 @@ import cn.hutool.core.io.IORuntimeException;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.core.io.StreamProgress;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.CharsetUtil;
|
||||
import cn.hutool.core.util.ReUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.util.URLUtil;
|
||||
@ -434,7 +433,10 @@ public class HttpResponse extends HttpBase<HttpResponse> implements Closeable {
|
||||
fileName = StrUtil.subSuf(path, path.lastIndexOf('/') + 1);
|
||||
if (StrUtil.isBlank(fileName)) {
|
||||
// 编码后的路径做为文件名
|
||||
fileName = URLUtil.encodeQuery(path, CharsetUtil.CHARSET_UTF_8);
|
||||
fileName = URLUtil.encodeQuery(path, charset);
|
||||
} else {
|
||||
// issue#I4K0FS@Gitee
|
||||
fileName = URLUtil.decode(fileName, charset);
|
||||
}
|
||||
}
|
||||
return FileUtil.file(targetFileOrDir, fileName);
|
||||
|
Loading…
x
Reference in New Issue
Block a user