summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2022-05-07 02:12:46 +0300
committerEd Tanous <ed@tanous.net>2022-05-19 20:30:51 +0300
commit6a409c12ced1ae98773ea018767e386ace2ed742 (patch)
treed89475175f3722b6ee5c8088d943b9c4ff8fd40d
parent039a47e3474d5667d295984f330e876aef309eac (diff)
downloadbmcweb-6a409c12ced1ae98773ea018767e386ace2ed742.tar.xz
Change query param errors to be 400 instead of 403
Any query param errors from the base registry being sent imply that the user-provided parameters were bad, which should return bad request, not forbidden. This is in line with the spec. Luckily, the only usage of these parameters as of now is from within the query params support model, so changing it shouldn't cause any backward compatibility issues, and because these are meant for "bad request" type messages, it's unlikely it would even be able to effect clients. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I13a4601d1236d9eaac6bbf5fb25e0f1b28c04a21
-rw-r--r--redfish-core/src/error_messages.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/redfish-core/src/error_messages.cpp b/redfish-core/src/error_messages.cpp
index 6353167013..95bbea79b1 100644
--- a/redfish-core/src/error_messages.cpp
+++ b/redfish-core/src/error_messages.cpp
@@ -1441,7 +1441,7 @@ nlohmann::json queryNotSupportedOnResource(void)
void queryNotSupportedOnResource(crow::Response& res)
{
- res.result(boost::beast::http::status::forbidden);
+ res.result(boost::beast::http::status::bad_request);
addMessageToErrorJson(res.jsonValue, queryNotSupportedOnResource());
}
@@ -1460,7 +1460,7 @@ nlohmann::json queryNotSupportedOnOperation(void)
void queryNotSupportedOnOperation(crow::Response& res)
{
- res.result(boost::beast::http::status::forbidden);
+ res.result(boost::beast::http::status::bad_request);
addMessageToErrorJson(res.jsonValue, queryNotSupportedOnOperation());
}