account_service: Remove success body on 204 response
Currently, PATCH requests updating Password to
/redfish/v1/AccountService/Accounts/{username} will return non-empty
body despite the status code is 204 No Content:
```
curl -X PATCH --user root:0penBmc -H "Content-Type: application/json" --insecure https://${BMC_IP}/redfish/v1/AccountService/Accounts/user_test01 -d '{"Password": "0penBmc"}'
```
```
Sep 29 02:45:09 mtmitchell-dcscm bmcwebd[947]: [http_response.hpp:212] 0x1bce918 Response content provided but code was no-content or not_modified, which aren't allowed to have a body for url : "/redfish/v1/AccountService/Accounts/user_test01"
```
This fixes the issue by removing the success body.
Tested: PATCH requests now do not create the error log.
Signed-off-by: Khang D Nguyen <khangng@os.amperecomputing.com>
Change-Id: I6a6a6964eed4b9ef591f59b5223cc24b9b82680f
diff --git a/redfish-core/lib/account_service.hpp b/redfish-core/lib/account_service.hpp
index 56152c9..11cdbb9 100644
--- a/redfish-core/lib/account_service.hpp
+++ b/redfish-core/lib/account_service.hpp
@@ -1159,7 +1159,6 @@
persistent_data::SessionStore::getInstance()
.removeSessionsByUsernameExceptSession(params.username,
params.session);
- messages::success(asyncResp->res);
}
}