Fix handling of nested custom page wildcard paths, closes #996

This commit is contained in:
Simon Willison 2020-10-07 15:51:11 -07:00
commit 5070425817
4 changed files with 11 additions and 4 deletions

View file

@ -1204,7 +1204,7 @@ def route_pattern_from_filepath(filepath):
re_bits.append("(?P<{}>[^/]*)".format(bit[1:-1]))
else:
re_bits.append(re.escape(bit))
return re.compile("".join(re_bits))
return re.compile("^" + "".join(re_bits) + "$")
class NotFoundExplicit(NotFound):