Redfish: Allow slash at the end of Resource
This is defined in the Redfish protocol.
Easiest way to allow this is to end the Node URL with "/", which most
Nodes in bmcweb already had.
Before:
curl -k https://${bmc}/redfish/v1/TaskService/
Not Found
After both /redfish/v1/TaskService/ and /redfish/v1/TaskService
return the Task Service.
Tested:
Validator passed.
Change-Id: Ic806dc5c91f631b87642e49b486a6b6da7fdf955
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
diff --git a/redfish-core/lib/ethernet.hpp b/redfish-core/lib/ethernet.hpp
index bf5daed..702136a 100644
--- a/redfish-core/lib/ethernet.hpp
+++ b/redfish-core/lib/ethernet.hpp
@@ -2075,7 +2075,7 @@
template <typename CrowApp>
VlanNetworkInterface(CrowApp &app) :
Node(app,
- "/redfish/v1/Managers/bmc/EthernetInterfaces/<str>/VLANs/<str>",
+ "/redfish/v1/Managers/bmc/EthernetInterfaces/<str>/VLANs/<str>/",
std::string(), std::string())
{
entityPrivileges = {
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
index 4d4a360..d53c829 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -2054,7 +2054,7 @@
public:
DBusLogServiceActionsClear(CrowApp &app) :
Node(app, "/redfish/v1/Systems/system/LogServices/EventLog/Actions/"
- "LogService.ClearLog")
+ "LogService.ClearLog/")
{
entityPrivileges = {
{boost::beast::http::verb::get, {{"Login"}}},
diff --git a/redfish-core/lib/network_protocol.hpp b/redfish-core/lib/network_protocol.hpp
index 03f7bf8..3d61274 100644
--- a/redfish-core/lib/network_protocol.hpp
+++ b/redfish-core/lib/network_protocol.hpp
@@ -131,7 +131,7 @@
{
public:
NetworkProtocol(CrowApp& app) :
- Node(app, "/redfish/v1/Managers/bmc/NetworkProtocol")
+ Node(app, "/redfish/v1/Managers/bmc/NetworkProtocol/")
{
entityPrivileges = {
{boost::beast::http::verb::get, {{"Login"}}},
diff --git a/redfish-core/lib/storage.hpp b/redfish-core/lib/storage.hpp
index 66d1099..cfbcb6f 100644
--- a/redfish-core/lib/storage.hpp
+++ b/redfish-core/lib/storage.hpp
@@ -54,7 +54,7 @@
class Storage : public Node
{
public:
- Storage(CrowApp &app) : Node(app, "/redfish/v1/Systems/system/Storage/1")
+ Storage(CrowApp &app) : Node(app, "/redfish/v1/Systems/system/Storage/1/")
{
entityPrivileges = {
{boost::beast::http::verb::get, {{"Login"}}},
diff --git a/redfish-core/lib/task.hpp b/redfish-core/lib/task.hpp
index e224d6c..fa072a7 100644
--- a/redfish-core/lib/task.hpp
+++ b/redfish-core/lib/task.hpp
@@ -231,7 +231,7 @@
{
public:
TaskMonitor(CrowApp &app) :
- Node((app), "/redfish/v1/TaskService/Tasks/<str>/Monitor",
+ Node((app), "/redfish/v1/TaskService/Tasks/<str>/Monitor/",
std::string())
{
entityPrivileges = {
@@ -288,7 +288,7 @@
{
public:
Task(CrowApp &app) :
- Node((app), "/redfish/v1/TaskService/Tasks/<str>", std::string())
+ Node((app), "/redfish/v1/TaskService/Tasks/<str>/", std::string())
{
entityPrivileges = {
{boost::beast::http::verb::get, {{"Login"}}},
@@ -362,7 +362,7 @@
class TaskCollection : public Node
{
public:
- TaskCollection(CrowApp &app) : Node(app, "/redfish/v1/TaskService/Tasks")
+ TaskCollection(CrowApp &app) : Node(app, "/redfish/v1/TaskService/Tasks/")
{
entityPrivileges = {
{boost::beast::http::verb::get, {{"Login"}}},
@@ -402,7 +402,7 @@
class TaskService : public Node
{
public:
- TaskService(CrowApp &app) : Node(app, "/redfish/v1/TaskService")
+ TaskService(CrowApp &app) : Node(app, "/redfish/v1/TaskService/")
{
entityPrivileges = {
{boost::beast::http::verb::get, {{"Login"}}},