Revert "Handle HEAD and Allow headers per the spec"

This reverts commit 867b2056d44300db9769e0d0b8883435a179834c.

Apparently we have broken the Redfish spec in a way that adding this
feature now allows the service validator to find.

@odata.id	/redfish/v1/UpdateService
ERROR - Allow header should NOT contain POST for UpdateService.v1_5_0.UpdateService

Need to figure out what to do, but for now, revert to get the build
passing again.

Change-Id: Ieef20573b9caa03aba6fd2bbc999e517e4b7de3d
Signed-off-by: Ed Tanous <edtanous@google.com>
diff --git a/http/routing.hpp b/http/routing.hpp
index 7bac283..5f29761 100644
--- a/http/routing.hpp
+++ b/http/routing.hpp
@@ -12,7 +12,6 @@
 #include "websocket.hpp"
 
 #include <async_resp.hpp>
-#include <boost/beast/ssl/ssl_stream.hpp>
 #include <boost/container/flat_map.hpp>
 
 #include <cerrno>
@@ -1209,30 +1208,6 @@
         }
     }
 
-    std::string buildAllowHeader(Request& req)
-    {
-        std::string allowHeader;
-        // Check to see if this url exists at any verb
-        for (size_t perMethodIndex = 0; perMethodIndex < perMethods.size();
-             perMethodIndex++)
-        {
-            const PerMethod& p = perMethods[perMethodIndex];
-            const std::pair<unsigned, RoutingParams>& found2 =
-                p.trie.find(req.url);
-            if (found2.first == 0)
-            {
-                continue;
-            }
-            if (!allowHeader.empty())
-            {
-                allowHeader += ", ";
-            }
-            allowHeader += boost::beast::http::to_string(
-                static_cast<boost::beast::http::verb>(perMethodIndex));
-        }
-        return allowHeader;
-    }
-
     void handle(Request& req,
                 const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
     {
@@ -1244,31 +1219,25 @@
         PerMethod& perMethod = perMethods[static_cast<size_t>(req.method())];
         Trie& trie = perMethod.trie;
         std::vector<BaseRule*>& rules = perMethod.rules;
-        std::string allowHeader = buildAllowHeader(req);
-        if (!allowHeader.empty())
-        {
-            asyncResp->res.addHeader(boost::beast::http::field::allow,
-                                     allowHeader);
-
-            // If this is a header request, we're done.
-            if (req.method() == boost::beast::http::verb::head)
-            {
-                return;
-            }
-        }
 
         const std::pair<unsigned, RoutingParams>& found = trie.find(req.url);
 
         unsigned ruleIndex = found.first;
+
         if (ruleIndex == 0U)
         {
-            if (!allowHeader.empty())
+            // Check to see if this url exists at any verb
+            for (const PerMethod& p : perMethods)
             {
-                asyncResp->res.result(
-                    boost::beast::http::status::method_not_allowed);
-                return;
+                const std::pair<unsigned, RoutingParams>& found2 =
+                    p.trie.find(req.url);
+                if (found2.first > 0)
+                {
+                    asyncResp->res.result(
+                        boost::beast::http::status::method_not_allowed);
+                    return;
+                }
             }
-
             BMCWEB_LOG_DEBUG << "Cannot match rules " << req.url;
             asyncResp->res.result(boost::beast::http::status::not_found);
             return;
diff --git a/http/ut/router_test.cpp b/http/ut/router_test.cpp
deleted file mode 100644
index da0f72c..0000000
--- a/http/ut/router_test.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-#include "http_request.hpp"
-#include "routing.hpp"
-
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
-
-TEST(Router, AllowHeader)
-{
-    // Callback handler that does nothing
-    auto nullCallback = [](const crow::Request&,
-                           const std::shared_ptr<bmcweb::AsyncResp>&) {};
-
-    crow::Router router;
-    std::error_code ec;
-
-    constexpr const std::string_view url = "/foo";
-
-    crow::Request req{{boost::beast::http::verb::get, url, 11}, ec};
-
-    // No route should return no methods.
-    router.validate();
-    EXPECT_EQ(router.buildAllowHeader(req), "");
-
-    router
-        .newRuleTagged<crow::black_magic::getParameterTag(url)>(
-            std::string(url))
-        .methods(boost::beast::http::verb::get)(nullCallback);
-    router.validate();
-    EXPECT_EQ(router.buildAllowHeader(req), "GET");
-
-    router
-        .newRuleTagged<crow::black_magic::getParameterTag(url)>(
-            std::string(url))
-        .methods(boost::beast::http::verb::patch)(nullCallback);
-    router.validate();
-    EXPECT_EQ(router.buildAllowHeader(req), "GET, PATCH");
-}
\ No newline at end of file
diff --git a/meson.build b/meson.build
index 182927d..e8897b3 100644
--- a/meson.build
+++ b/meson.build
@@ -379,7 +379,6 @@
 
 srcfiles_unittest = [
   'http/ut/utility_test.cpp',
-  'http/ut/router_test.cpp',
   'include/ut/dbus_utility_test.cpp',
   'include/ut/http_utility_test.cpp',
   'include/ut/human_sort_test.cpp',