Skip to content

Commit b752c92

Browse files
committed
Fix router lang match on root paths
1 parent b4b0824 commit b752c92

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

emmett_core/routing/router.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ def _split_lang(router, path):
106106
if len(path) <= 1:
107107
return path, default
108108
clean_path = path.lstrip("/")
109-
if clean_path[2:3] == "/":
109+
next_sep = clean_path[2:3]
110+
if not next_sep or next_sep == "/":
110111
lang, new_path = clean_path[:2], clean_path[2:]
111112
if lang != default and lang in router.app._languages_set:
112113
return new_path, lang

0 commit comments

Comments
 (0)