更好的检查子路径逻辑

This commit is contained in:
yuxiaoyuan0406 2023-04-20 18:31:26 +08:00
parent f0ff1f2c64
commit 9945d5048a

View File

@ -540,6 +540,9 @@ def custom_path_check(path: str)->bool:
print("ilegal custom path: {}\npath must not be empty\ndeploy on root url".format(path))
return False
if path[0] == '/':
if len(path) == 1:
print("deploy on root url")
return False
if path[1] != '/':
print("deploy on sub-path {}".format(path))
return True