Commit e66e5f20 by Sheng

Added set_default_headers

parent 66ebe2ce
...@@ -39,6 +39,9 @@ class InvalidValueError(Exception): ...@@ -39,6 +39,9 @@ class InvalidValueError(Exception):
class MixinHandler(object): class MixinHandler(object):
def set_default_headers(self):
self.set_header('Server', 'TornadoServer')
def get_value(self, name): def get_value(self, name):
value = self.get_argument(name) value = self.get_argument(name)
if not value: if not value:
...@@ -85,7 +88,6 @@ class IndexHandler(MixinHandler, tornado.web.RequestHandler): ...@@ -85,7 +88,6 @@ class IndexHandler(MixinHandler, tornado.web.RequestHandler):
self._reason = reason self._reason = reason
self.result.update(status=self._reason) self.result.update(status=self._reason)
self.set_status(200) self.set_status(200)
self.set_header('Server', 'TornadoServer')
self.finish(self.result) self.finish(self.result)
def get_ssh_client(self): def get_ssh_client(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment