if the route begin with a "/" we remove it

This commit is contained in:
Maxime Alves LIRMM 2020-09-22 16:08:01 +02:00
parent a78e6ebc75
commit 39d455b682
1 changed files with 3 additions and 0 deletions

View File

@ -36,6 +36,9 @@ def get_fct_name(http_verb, path: str):
>>> get_fct_name('DEL', '{boo:zoo}/far')
'del_BOO_far'
"""
if path and path[0] == '/':
path = path[1:]
fct_name = [http_verb.lower()]
for elt in path.split('/'):
if elt and elt[0] == '{':