summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMatt Spinler <spinler@us.ibm.com>2019-01-22 13:45:51 -0600
committerEd Tanous <ed.tanous@intel.com>2019-01-23 20:02:08 +0000
commit62d2e8b66c370d453c00b1e1ae751f1c9c5d3f4b (patch)
treec656f0e862c17677ee0272db79f523ea25fbf8e4 /include
parentc90085012c6586d19ecc6cc158f2018c9dbfdd06 (diff)
downloadbmcweb-62d2e8b66c370d453c00b1e1ae751f1c9c5d3f4b.tar.gz
bmcweb-62d2e8b66c370d453c00b1e1ae751f1c9c5d3f4b.zip
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>
Diffstat (limited to 'include')
-rw-r--r--include/openbmc_dbus_rest.hpp5
1 files changed, 3 insertions, 2 deletions
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 @@ void handleDelete(const crow::Request &req, crow::Response &res,
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;
}
OpenPOWER on IntegriCloud