HEAD method is now supported by all URIs
authorCalin Crisan <ccrisan@gmail.com>
Sat, 2 Jul 2016 15:01:04 +0000 (18:01 +0300)
committerCalin Crisan <ccrisan@gmail.com>
Sat, 2 Jul 2016 15:01:04 +0000 (18:01 +0300)
motioneye/handlers.py

index 4eb923148d738ca4caa1cbe52f9d7b9b888a1c89..7ea04250028dc3dacd5f256fcd9082c29e93a33c 100644 (file)
@@ -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