Add PATCH and HEAD remove OPTIONS

This commit is contained in:
0880
2026-01-17 18:13:32 +03:30
parent b35ab73daa
commit ba149b2d47

View File

@@ -135,11 +135,20 @@ class App:
return decorator
def OPTIONS(self, path: str):
"""Decorator to register a OPTIONS HTTP route."""
def PATCH(self, path: str):
"""Decorator to register a PATCH HTTP route."""
def decorator(func: Callable[[Request, ...], Awaitable[bytes]]):
self._serve(path, "OPTIONS", func)
self._serve(path, "PATCH", func)
return func
return decorator
def HEAD(self, path: str):
"""Decorator to register a HEAD HTTP route."""
def decorator(func: Callable[[Request, ...], Awaitable[bytes]]):
self._serve(path, "HEAD", func)
return func
return decorator