mirror of https://github.com/huashengdun/webssh
Added head method IndexHandler
parent
a68eff592f
commit
7e5a170383
|
@ -613,3 +613,18 @@ class TestAppNotFoundHandler(OtherTestBase):
|
||||||
response.headers['Server'], self.custom_headers['Server']
|
response.headers['Server'], self.custom_headers['Server']
|
||||||
)
|
)
|
||||||
self.assertIn(b'404: Not Found', response.body)
|
self.assertIn(b'404: Not Found', response.body)
|
||||||
|
|
||||||
|
|
||||||
|
class TestAppHeadRequest(OtherTestBase):
|
||||||
|
|
||||||
|
def test_with_index_path(self):
|
||||||
|
response = self.fetch('/', method='HEAD')
|
||||||
|
self.assertEqual(response.code, 200)
|
||||||
|
|
||||||
|
def test_with_ws_path(self):
|
||||||
|
response = self.fetch('/ws', method='HEAD')
|
||||||
|
self.assertEqual(response.code, 405)
|
||||||
|
|
||||||
|
def test_with_not_found_path(self):
|
||||||
|
response = self.fetch('/notfound', method='HEAD')
|
||||||
|
self.assertEqual(response.code, 404)
|
||||||
|
|
|
@ -288,6 +288,9 @@ class IndexHandler(MixinHandler, tornado.web.RequestHandler):
|
||||||
else:
|
else:
|
||||||
future.set_result(worker)
|
future.set_result(worker)
|
||||||
|
|
||||||
|
def head(self):
|
||||||
|
pass
|
||||||
|
|
||||||
def get(self):
|
def get(self):
|
||||||
self.render('index.html', debug=self.debug)
|
self.render('index.html', debug=self.debug)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue