Skip to content

Commit 85b452b

Browse files
committed
Fix: Incorrect parsing of default route methods
1 parent 3336d40 commit 85b452b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

adafruit_httpserver/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def route_func(request):
115115
if path.endswith("/") and append_slash:
116116
raise ValueError("Cannot use append_slash=True when path ends with /")
117117

118-
methods = methods if isinstance(methods, set) else set(methods)
118+
methods = set(methods) if isinstance(methods, (set, list)) else set([methods])
119119

120120
def route_decorator(func: Callable) -> Callable:
121121
self._routes.add(_Route(path, methods, append_slash), func)

0 commit comments

Comments
 (0)