mirror of
https://gitee.com/kekingcn/file-online-preview.git
synced 2025-04-05 17:37:49 +08:00
修复在反代情况下 压缩包获取路径的错误
This commit is contained in:
parent
a59abd179f
commit
db3f03bda9
@ -38,13 +38,9 @@ public class DownloadUtils {
|
|||||||
public static ReturnResponse<String> downLoad(FileAttribute fileAttribute, String fileName) {
|
public static ReturnResponse<String> downLoad(FileAttribute fileAttribute, String fileName) {
|
||||||
// 忽略ssl证书
|
// 忽略ssl证书
|
||||||
String urlStr = null;
|
String urlStr = null;
|
||||||
String urlStrr = null;
|
|
||||||
URL urll;
|
|
||||||
try {
|
try {
|
||||||
SslUtils.ignoreSsl();
|
SslUtils.ignoreSsl();
|
||||||
urlStr = fileAttribute.getUrl().replaceAll("\\+", "%20");
|
urlStr = fileAttribute.getUrl().replaceAll("\\+", "%20");
|
||||||
urll = new URL(urlStr);
|
|
||||||
urlStrr = URLDecoder.decode(urll.getPath(), "UTF-8");
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("忽略SSL证书异常:", e);
|
logger.error("忽略SSL证书异常:", e);
|
||||||
}
|
}
|
||||||
@ -58,7 +54,7 @@ public class DownloadUtils {
|
|||||||
}
|
}
|
||||||
assert urlStr != null;
|
assert urlStr != null;
|
||||||
if (urlStr.contains("?fileKey=")) {
|
if (urlStr.contains("?fileKey=")) {
|
||||||
response.setContent(fileDir + urlStrr);
|
response.setContent(fileDir + fileName);
|
||||||
response.setMsg(fileName);
|
response.setMsg(fileName);
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user