Added check_request method to MixinHandler

pull/58/head
Sheng 2018-11-15 21:40:59 +08:00
parent 32f303474e
commit d6d5f74f2a
1 changed files with 4 additions and 1 deletions

View File

@ -61,6 +61,10 @@ class MixinHandler(object):
'{reason}</body></html>') '{reason}</body></html>')
def initialize(self, loop=None): def initialize(self, loop=None):
self.check_request()
self.loop = loop
def check_request(self):
context = self.request.connection.context context = self.request.connection.context
result = self.is_forbidden(context, self.request.host_name) result = self.is_forbidden(context, self.request.host_name)
self._transforms = [] self._transforms = []
@ -75,7 +79,6 @@ class MixinHandler(object):
) )
self.redirect(to_url, permanent=True) self.redirect(to_url, permanent=True)
else: else:
self.loop = loop
self.context = context self.context = context
def is_forbidden(self, context, hostname): def is_forbidden(self, context, hostname):