diff options
-rw-r--r-- | icespider/core/core.cpp | 4 | ||||
-rw-r--r-- | icespider/unittests/testApp.cpp | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/icespider/core/core.cpp b/icespider/core/core.cpp index 525a99f..ba236ac 100644 --- a/icespider/core/core.cpp +++ b/icespider/core/core.cpp @@ -8,8 +8,8 @@ namespace ba = boost::algorithm; namespace IceSpider { Core::Core() { - // Big enough to map all the request methods - routes.resize(UserIceSpider::HttpMethod::OPTIONS + 1); + // Big enough to map all the request methods (an empty of zero lenght routes as default) + routes.resize(UserIceSpider::HttpMethod::OPTIONS + 1, {{ }}); // Initialize routes for (const auto & rp : AdHoc::PluginManager::getDefault()->getAll<IRouteHandler>()) { auto r = rp->implementation(); diff --git a/icespider/unittests/testApp.cpp b/icespider/unittests/testApp.cpp index e91f618..f79d331 100644 --- a/icespider/unittests/testApp.cpp +++ b/icespider/unittests/testApp.cpp @@ -25,15 +25,15 @@ BOOST_AUTO_TEST_CASE( testCoreSettings ) BOOST_REQUIRE_EQUAL(0, routes[HttpMethod::GET][1].size()); BOOST_REQUIRE_EQUAL(0, routes[HttpMethod::GET][2].size()); BOOST_REQUIRE_EQUAL(1, routes[HttpMethod::GET][3].size()); - BOOST_REQUIRE_EQUAL(0, routes[HttpMethod::HEAD].size()); + BOOST_REQUIRE_EQUAL(1, routes[HttpMethod::HEAD].size()); BOOST_REQUIRE_EQUAL(2, routes[HttpMethod::POST].size()); BOOST_REQUIRE_EQUAL(0, routes[HttpMethod::POST][0].size()); BOOST_REQUIRE_EQUAL(1, routes[HttpMethod::POST][1].size()); - BOOST_REQUIRE_EQUAL(0, routes[HttpMethod::PUT].size()); + BOOST_REQUIRE_EQUAL(1, routes[HttpMethod::PUT].size()); BOOST_REQUIRE_EQUAL(2, routes[HttpMethod::DELETE].size()); BOOST_REQUIRE_EQUAL(0, routes[HttpMethod::DELETE][0].size()); BOOST_REQUIRE_EQUAL(1, routes[HttpMethod::DELETE][1].size()); - BOOST_REQUIRE_EQUAL(0, routes[HttpMethod::OPTIONS].size()); + BOOST_REQUIRE_EQUAL(1, routes[HttpMethod::OPTIONS].size()); } class TestRequest : public IceSpider::IHttpRequest { |