Spaces:
Paused
Paused
yuxiaoyuan0406
commited on
Commit
•
9945d50
1
Parent(s):
f0ff1f2
更好的检查子路径逻辑
Browse files- toolbox.py +3 -0
toolbox.py
CHANGED
@@ -540,6 +540,9 @@ def custom_path_check(path: str)->bool:
|
|
540 |
print("ilegal custom path: {}\npath must not be empty\ndeploy on root url".format(path))
|
541 |
return False
|
542 |
if path[0] == '/':
|
|
|
|
|
|
|
543 |
if path[1] != '/':
|
544 |
print("deploy on sub-path {}".format(path))
|
545 |
return True
|
|
|
540 |
print("ilegal custom path: {}\npath must not be empty\ndeploy on root url".format(path))
|
541 |
return False
|
542 |
if path[0] == '/':
|
543 |
+
if len(path) == 1:
|
544 |
+
print("deploy on root url")
|
545 |
+
return False
|
546 |
if path[1] != '/':
|
547 |
print("deploy on sub-path {}".format(path))
|
548 |
return True
|