Skip to content

Commit 8ae6060

Browse files
author
Joel Collins
committed
Fix HTTP method check
1 parent 31a7a04 commit 8ae6060

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/labthings/server/view/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,10 @@ def dispatch_request(self, *args, **kwargs):
9191
meth = getattr(self, "get", None)
9292

9393
# Marhal response if a response schema is defines
94-
if meth in ("get", "put", "post", "patch") and self.get_schema():
94+
if (
95+
request.method in ("GET", "PUT", "POST", "PATCH", "DELETE")
96+
and self.get_schema()
97+
):
9598
meth = marshal_with(self.get_schema())(meth)
9699

97100
# Flask should ensure this is assersion never fails

0 commit comments

Comments
 (0)