fix: download url error
This commit is contained in:
parent
1580a214e8
commit
1450938d17
@ -107,9 +107,10 @@ public class FilePreviewServiceImpl implements FilePreviewService {
|
|||||||
*/
|
*/
|
||||||
private String replaceWithSelfAddress(String url, String targetIP) {
|
private String replaceWithSelfAddress(String url, String targetIP) {
|
||||||
// 正则匹配 http(s):// 后的 IPv4 地址
|
// 正则匹配 http(s):// 后的 IPv4 地址
|
||||||
Pattern pattern = Pattern.compile("(https?://)(\\d+\\.\\d+\\.\\d+\\.\\d+)");
|
Pattern pattern = Pattern.compile("https?://\\d+\\.\\d+\\.\\d+\\.\\d+");
|
||||||
Matcher matcher = pattern.matcher(url);
|
Matcher matcher = pattern.matcher(url);
|
||||||
return matcher.replaceAll("$1" + targetIP);
|
// 替换为新的协议和 IP 地址
|
||||||
|
return matcher.replaceAll(targetIP);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user