fix: modify extract driveId regex in WebDavController

This commit is contained in:
quericy
2022-04-14 10:06:46 +08:00
committed by chenyi23
parent e149039ecb
commit c6127c029f
2 changed files with 2 additions and 2 deletions

View File

@@ -27,7 +27,7 @@ public class WebDavUrlAdapterImpl implements UrlAdapter {
@Override
public String getUrl(Request request) {
// 匹配url前缀和驱动器ID
Matcher matcher = RegexMatchUtils.match("^" + ZFileConstant.WEB_DAV_PREFIX + "/(\\d+?)(.*)",
Matcher matcher = RegexMatchUtils.match("^" + ZFileConstant.WEB_DAV_PREFIX + "/(\\d+)(.*)",
HttpManager.decodeUrl(request.getAbsolutePath()));
final String driveId = RegexMatchUtils.getIndexResult(matcher, 1);
if (driveId == null) {

View File

@@ -153,7 +153,7 @@ public class WebDavController {
*/
private Integer getDriveId() {
String requestUrl = HttpManager.decodeUrl(HttpManager.request().getAbsolutePath());
final String driveId = RegexMatchUtils.matchByIndex("^" + ZFileConstant.WEB_DAV_PREFIX + "/(\\d+?)(.*)", requestUrl, 1);
final String driveId = RegexMatchUtils.matchByIndex("^" + ZFileConstant.WEB_DAV_PREFIX + "/(\\d+)(.*)", requestUrl, 1);
return driveId != null ? Integer.valueOf(driveId) : null;
}
}