Skip to content

Commit

Permalink
base_rest: allow multiple http method in routes
Browse files Browse the repository at this point in the history
  • Loading branch information
sbidoul committed Jun 29, 2021
1 parent 5ba68d5 commit f39be5c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions base_rest/restapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,13 @@ def method(

def decorator(f):
_routes = []
for paths, http_method in routes:
for paths, http_methods in routes:
if not isinstance(paths, list):
paths = [paths]
_routes.append(([p for p in paths], http_method))
if not isinstance(http_methods, list):
http_methods = [http_methods]
for m in http_methods:
_routes.append(([p for p in paths], m))
routing = {
"csrf": csrf,
"auth": auth,
Expand Down

0 comments on commit f39be5c

Please sign in to comment.