Skip to content

Commit

Permalink
Inline validate_method()
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov committed Aug 2, 2016
1 parent 4cd55d4 commit df7b41b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions aiohttp/web_urldispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def __init__(self, method, handler, *,
'Coroutine is expected, got {!r}'.format(expect_handler)

method = method.upper()
if not self.validate_method(method):
if not HTTP_METHOD_RE.match(method):
raise ValueError("{} is not allowed HTTP method".format(method))

assert callable(handler), handler
Expand All @@ -105,9 +105,6 @@ def handler_wrapper(*args, **kwargs):
self._expect_handler = expect_handler
self._resource = resource

def validate_method(self, method):
return HTTP_METHOD_RE.match(method)

@property
def method(self):
return self._method
Expand Down

0 comments on commit df7b41b

Please sign in to comment.