From: Calin Crisan Date: Sat, 2 Jul 2016 15:01:04 +0000 (+0300) Subject: HEAD method is now supported by all URIs X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=d78a9c1cb5bb3ac6802016155399344dfdd09c65;p=motioneye-debian HEAD method is now supported by all URIs --- diff --git a/motioneye/handlers.py b/motioneye/handlers.py index 4eb9231..7ea0425 100644 --- a/motioneye/handlers.py +++ b/motioneye/handlers.py @@ -175,13 +175,15 @@ class BaseHandler(RequestHandler): 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 @@ class MainHandler(BaseHandler): old_motion=config.is_old_motion(), has_motion=bool(motionctl.find_motion())) - def head(self): - self.finish() - class ConfigHandler(BaseHandler): @asynchronous