summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2022-05-12 00:46:44 +0300
committerEd Tanous <ed@tanous.net>2022-05-16 19:44:46 +0300
commitc02a74f8504bc42d6e03721aa426d043b6658820 (patch)
treee559146f69dc5f888d5ceef159354526edf4d1e4
parentd3355c5cdd4ce4e39df7d2f424eb4a60fee16731 (diff)
downloadbmcweb-c02a74f8504bc42d6e03721aa426d043b6658820.tar.xz
Return OData.Version with responses
The Redfish specification section 8.1 lists header values that should be returned from responses. It lists OData.Version: 4.0 as required in this same section. Implement this to the specification. Tested: Redfish protocol validator RESP_HEADERS_ODATA_VERSION test now passes. curl --vvv https://$bmc/redfish/v1 shows Odata.Version header set in response. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Id02ec218299524905fbd91cb161bfe727a51fc65
-rw-r--r--redfish-core/include/query.hpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/redfish-core/include/query.hpp b/redfish-core/include/query.hpp
index 0647a6145c..88859e11be 100644
--- a/redfish-core/include/query.hpp
+++ b/redfish-core/include/query.hpp
@@ -29,6 +29,8 @@ namespace redfish
return false;
}
+ res.addHeader("OData-Version", "4.0");
+
std::optional<query_param::Query> queryOpt =
query_param::parseParameters(req.urlView.params(), res);
if (queryOpt == std::nullopt)