Fix response error code for error - Unauthorized
Tested by:
Request: Creating session with wrong credential.
curl --insecure -X POST -D headers.txt https://${BMC_IP}/redfish/v1/SessionService/Sessions
-d '{"UserName":"root", "Password":"penBmc"}'
Resonse Error code: HTTP/1.1 401 Unauthorized
Signed-off-by: Sunitha Harish <sunithaharish04@gmail.com>
Change-Id: I9c7b0af644f1e3d987b4f76e4206bbb276aba035
diff --git a/redfish-core/src/error_messages.cpp b/redfish-core/src/error_messages.cpp
index bc4cba6..0eda7b4 100644
--- a/redfish-core/src/error_messages.cpp
+++ b/redfish-core/src/error_messages.cpp
@@ -251,7 +251,7 @@
void resourceAtUriUnauthorized(crow::Response& res, const std::string& arg1,
const std::string& arg2)
{
- res.result(boost::beast::http::status::forbidden);
+ res.result(boost::beast::http::status::unauthorized);
addMessageToErrorJson(
res.jsonValue,
nlohmann::json{