cleanup flask paths with trailing slashes.

This commit is contained in:
Steve Pulec 2016-01-24 17:13:32 -05:00
commit eba9033cc9
2 changed files with 12 additions and 8 deletions

View file

@ -74,6 +74,10 @@ def convert_regex_to_flask_path(url_path):
return '<regex("{0}"):{1}>'.format(match_pattern, match_name)
url_path = re.sub("\(\?P<(.*?)>(.*?)\)", caller, url_path)
if url_path.endswith("/?"):
# Flask does own handling of trailing slashes
url_path = url_path.rstrip("/?")
return url_path