REST: Return a 405 on bad DELETE paths
Return a method_not_allowed response when the path for a
DELETE is invalid. This matches what the phosphor-rest
server did.
Change-Id: I6db577d25d92bdbee9e97355ff11a15a5c68288b
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/include/openbmc_dbus_rest.hpp b/include/openbmc_dbus_rest.hpp
index e310b1a..5a00572 100644
--- a/include/openbmc_dbus_rest.hpp
+++ b/include/openbmc_dbus_rest.hpp
@@ -1480,8 +1480,9 @@
if (ec || interfaceNames.size() <= 0)
{
BMCWEB_LOG_ERROR << "Can't find object";
- setErrorResponse(res, boost::beast::http::status::not_found,
- notFoundDesc, notFoundMsg);
+ setErrorResponse(res,
+ boost::beast::http::status::method_not_allowed,
+ methodNotAllowedDesc, methodNotAllowedMsg);
res.end();
return;
}