Allow clients to call HEAD

The HEAD method allows clients to get page response headers
without actually downloading the content.

Change-Id: Id69db83a74015df3a9f84d36f91a4a12e11ea7b6
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/module/obmc/wsgi/apps/rest_dbus.py b/module/obmc/wsgi/apps/rest_dbus.py
index 95b9cb0..aa08bfa 100644
--- a/module/obmc/wsgi/apps/rest_dbus.py
+++ b/module/obmc/wsgi/apps/rest_dbus.py
@@ -74,18 +74,27 @@
         self._rules = rules
         self.intf_match = obmc.utils.misc.org_dot_openbmc_match
 
+        if 'GET' in self._verbs:
+            self._verbs = list(set(self._verbs + ['HEAD']))
+
     def _setup(self, **kw):
         request.route_data = {}
         if request.method in self._verbs:
             return self.setup(**kw)
-        else:
-            self.find(**kw)
-            raise HTTPError(
-                405, "Method not allowed.", Allow=','.join(self._verbs))
+
+        # Return 404 if path not found.
+        self.find(**kw)
+
+        # Return 405.
+        raise HTTPError(
+            405, "Method not allowed.", Allow=','.join(self._verbs))
 
     def __call__(self, **kw):
         return getattr(self, 'do_' + request.method.lower())(**kw)
 
+    def do_head(self, **kw):
+        return self.do_get(**kw)
+
     def install(self):
         self.app.route(
             self._rules, callback=self,