Skip to content

Commit 6dd40ec

Browse files
minrkmanics
andauthored
raise ValueError if generate_rule is called incorrectly
Co-authored-by: Simon Li <[email protected]>
1 parent f692b9e commit 6dd40ec

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

jupyterhub_traefik_proxy/traefik_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ def validate(self, obj, value):
2323

2424
def generate_rule(routespec):
2525
# validate assumption that routespecs always end with '/'
26-
assert routespec.endswith("/")
26+
if not routespec.endswith("/"):
27+
raise ValueError("routespec must end with /")
2728
routespec = unquote(routespec)
2829

2930
# traefik won't match /proxy/path to /proxy/path/

0 commit comments

Comments
 (0)