summaryrefslogtreecommitdiff
path: root/redfish-core/lib/update_service.hpp
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2022-05-11 22:36:59 +0300
committerEd Tanous <ed@tanous.net>2022-05-17 18:11:03 +0300
commit32ca38afffa7cd91a4bd6be19b415e93cc89d224 (patch)
treede7344023b9aa9adc29f1b91dfcfcb2abbdbbb8b /redfish-core/lib/update_service.hpp
parent4dc23f3fb6c9a7cef84658f8ab3b703d29ec7d57 (diff)
downloadbmcweb-32ca38afffa7cd91a4bd6be19b415e93cc89d224.tar.xz
Fake out allow header in UpdateService
In an attempt to smooth out the transition on changing the URI for /redfish/v1/UpdateService:HttpPushUri, this patch modifies the allow header on the /redfish/v1/UpdateService to return the "wrong" value, and remove POST from the list of allowed verbs. While this is technically incorrect, this field is new, so there can't be any users relying on it, and if they were to use it, they would ideally code to HttpPushUri as the spec would suggest. Tested: Redfish-service-validator passes. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ida3bdb772646253af5376bc8e0e13db285048b93
Diffstat (limited to 'redfish-core/lib/update_service.hpp')
-rw-r--r--redfish-core/lib/update_service.hpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/redfish-core/lib/update_service.hpp b/redfish-core/lib/update_service.hpp
index 53ee1ad3be..c8b13816ed 100644
--- a/redfish-core/lib/update_service.hpp
+++ b/redfish-core/lib/update_service.hpp
@@ -581,6 +581,15 @@ inline void requestRoutesUpdateService(App& app)
"Service for Software Update";
asyncResp->res.jsonValue["Name"] = "Update Service";
+#ifdef BMCWEB_ENABLE_REDFISH_UPDATESERVICE_OLD_POST_URL
+ // See note about later on in this file about why this is neccesary
+ // This is "Wrong" per the standard, but is done temporarily to
+ // avoid noise in failing tests as people transition to having this
+ // option disabled
+ asyncResp->res.addHeader(boost::beast::http::field::allow,
+ "GET, PATCH, HEAD");
+#endif
+
asyncResp->res.jsonValue["HttpPushUri"] =
"/redfish/v1/UpdateService/update";