From 39d455b682db6b6026d4699bb880ee1f9f17d7a3 Mon Sep 17 00:00:00 2001 From: Maxime Alves LIRMM Date: Tue, 22 Sep 2020 16:08:01 +0200 Subject: [PATCH] if the route begin with a "/" we remove it --- halfapi/lib/domain.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/halfapi/lib/domain.py b/halfapi/lib/domain.py index a99be7c..03a5442 100644 --- a/halfapi/lib/domain.py +++ b/halfapi/lib/domain.py @@ -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] == '{':