Add PATCH and HEAD remove OPTIONS
This commit is contained in:
15
slow/slow.py
15
slow/slow.py
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user