cleanup flask paths with trailing slashes.
This commit is contained in:
parent
a7938ed9ec
commit
eba9033cc9
2 changed files with 12 additions and 8 deletions
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue