Add unit test for trailing slashes
Common error #9 requires that most urls end in a trailing slash. Given
the redfish standard, we know that all redfish routes need to end in a
trailing slash, so write a unit test that verifies that is true.
Despite code review, this appears to have snuck into the codebase in 4
different handlers. Fix those at the same time so the tests pass.
Tested: Unit tests pass.
Change-Id: I0299a7231662725a7100d5308b3977a549b49253
Signed-off-by: Ed Tanous <etanous@nvidia.com>
diff --git a/redfish-core/lib/account_service.hpp b/redfish-core/lib/account_service.hpp
index 8bb746e..2ec3e32 100644
--- a/redfish-core/lib/account_service.hpp
+++ b/redfish-core/lib/account_service.hpp
@@ -2277,21 +2277,21 @@
BMCWEB_ROUTE(
app,
- "/redfish/v1/AccountService/MultiFactorAuth/ClientCertificate/Certificates")
+ "/redfish/v1/AccountService/MultiFactorAuth/ClientCertificate/Certificates/")
.privileges(redfish::privileges::headCertificateCollection)
.methods(boost::beast::http::verb::head)(std::bind_front(
handleAccountServiceClientCertificatesHead, std::ref(app)));
BMCWEB_ROUTE(
app,
- "/redfish/v1/AccountService/MultiFactorAuth/ClientCertificate/Certificates")
+ "/redfish/v1/AccountService/MultiFactorAuth/ClientCertificate/Certificates/")
.privileges(redfish::privileges::getCertificateCollection)
.methods(boost::beast::http::verb::get)(std::bind_front(
handleAccountServiceClientCertificatesGet, std::ref(app)));
BMCWEB_ROUTE(
app,
- "/redfish/v1/AccountService/MultiFactorAuth/ClientCertificate/Certificates/<str>")
+ "/redfish/v1/AccountService/MultiFactorAuth/ClientCertificate/Certificates/<str>/")
.privileges(redfish::privileges::headCertificate)
.methods(boost::beast::http::verb::head)(std::bind_front(
handleAccountServiceClientCertificatesInstanceHead, std::ref(app)));