From d78a9c1cb5bb3ac6802016155399344dfdd09c65 Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Sat, 2 Jul 2016 18:01:04 +0300 Subject: [PATCH] HEAD method is now supported by all URIs --- motioneye/handlers.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/motioneye/handlers.py b/motioneye/handlers.py index 4eb923148..7ea042500 100644 --- a/motioneye/handlers.py +++ b/motioneye/handlers.py @@ -175,13 +175,15 @@ def get(self, *args, **kwargs): def post(self, *args, **kwargs): raise HTTPError(400, 'method not allowed') + def head(self, *args, **kwargs): + self.finish() + class NotFoundHandler(BaseHandler): - def get(self): + def get(self, *args, **kwargs): raise HTTPError(404, 'not found') - def post(self): - raise HTTPError(404, 'not found') + post = head = get class MainHandler(BaseHandler): @@ -206,9 +208,6 @@ def get(self): old_motion=config.is_old_motion(), has_motion=bool(motionctl.find_motion())) - def head(self): - self.finish() - class ConfigHandler(BaseHandler): @asynchronous