Fix valid method condition
This commit is contained in:
@@ -100,7 +100,7 @@ class App:
|
|||||||
method: str,
|
method: str,
|
||||||
func: Callable[[Request, ...], Awaitable[Response]],
|
func: Callable[[Request, ...], Awaitable[Response]],
|
||||||
):
|
):
|
||||||
if method not in ["GET", "POST", "PUT", "DELETE"]:
|
if method not in ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD"]:
|
||||||
raise RuntimeError(f'Invalid method "{method}".')
|
raise RuntimeError(f'Invalid method "{method}".')
|
||||||
pat = self._pattern_to_regex(path)
|
pat = self._pattern_to_regex(path)
|
||||||
if pat not in self.routes:
|
if pat not in self.routes:
|
||||||
|
|||||||
Reference in New Issue
Block a user