Skip to content

Commit

Permalink
HEAD method is now supported by all URIs
Browse files Browse the repository at this point in the history
  • Loading branch information
ccrisan committed Jul 2, 2016
1 parent e2eb676 commit d78a9c1
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions motioneye/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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
Expand Down

0 comments on commit d78a9c1

Please sign in to comment.