mirror of
https://github.com/zfile-dev/zfile.git
synced 2025-04-19 05:34:52 +00:00
fix(bug): 修复又拍云文件中包含特殊字符时,调用 upyun 接口未进行 url encode 返回 400,影响又拍云单文件直链无法使用。
This commit is contained in:
@@ -22,6 +22,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
@@ -121,7 +122,7 @@ public class UpYunServiceImpl extends AbstractBaseFileService implements BaseFil
|
||||
int lastDelimiterIndex = path.lastIndexOf("/");
|
||||
String name = path.substring(lastDelimiterIndex + 1);
|
||||
|
||||
Map<String, String> fileInfo = upYun.getFileInfo(StringUtils.removeDuplicateSeparator(basePath + ZFileConstant.PATH_SEPARATOR + path));
|
||||
Map<String, String> fileInfo = upYun.getFileInfo(URLUtil.encode(StringUtils.removeDuplicateSeparator(basePath + ZFileConstant.PATH_SEPARATOR + path), StandardCharsets.UTF_8));
|
||||
|
||||
if (fileInfo == null) {
|
||||
throw new NotExistFileException();
|
||||
|
||||
Reference in New Issue
Block a user