For function decorators, ['GET'] is the default methods
This commit is contained in:
parent
1ad7b95437
commit
0a160c4a0b
|
@ -87,7 +87,7 @@ class Blueprint:
|
|||
for deferred in self.deferred_functions:
|
||||
deferred(state)
|
||||
|
||||
def route(self, uri, methods=None, host=None):
|
||||
def route(self, uri, methods=frozenset({'GET'}), host=None):
|
||||
"""
|
||||
"""
|
||||
def decorator(handler):
|
||||
|
|
|
@ -46,7 +46,7 @@ class Sanic:
|
|||
# -------------------------------------------------------------------- #
|
||||
|
||||
# Decorator
|
||||
def route(self, uri, methods=None, host=None):
|
||||
def route(self, uri, methods=frozenset({'GET'}), host=None):
|
||||
"""
|
||||
Decorates a function to be registered as a route
|
||||
:param uri: path of the URL
|
||||
|
|
|
@ -497,7 +497,7 @@ def test_overload_routes():
|
|||
def test_unmergeable_overload_routes():
|
||||
app = Sanic('test_dynamic_route')
|
||||
|
||||
@app.route('/overload_whole')
|
||||
@app.route('/overload_whole', methods=None)
|
||||
async def handler1(request):
|
||||
return text('OK1')
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user