commit | a1cbc1920833ae7f7cf9c2e7df06e37dc7f9f530 | [log] [tgz] |
---|---|---|
author | Hieu Huynh <hieuh@os.amperecomputing.com> | Wed Mar 29 07:24:42 2023 +0000 |
committer | Hieu Huynh <hieuh@os.amperecomputing.com> | Wed Mar 29 07:24:42 2023 +0000 |
tree | 5b87e1d2c69d57e9dcb597fc0bd77879a570c825 | |
parent | 797d5dae9eed4e783d065be24f5ac0bf4ffe1a1a [diff] [blame] |
Fix If Match header in Http layer Commit [1] prevents the clients performing methods if missing ETag from the If-Match header. For the "If-Match: *" [2] that representing any resource, it should be the valid command. [1] https://github.com/openbmc/bmcweb/commit/2d6cb56b6b47c3fbb0d234ade5c1208edb69ef1f [2] https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match Tested: Can performing methods GET/POST/PATCH/DELETE with "If-Match: *" header. Signed-off-by: Hieu Huynh <hieuh@os.amperecomputing.com> Change-Id: I2e5a81ed33336a939b01bd6b64d3ff99501341d0
diff --git a/redfish-core/include/query.hpp b/redfish-core/include/query.hpp index c5d537b..1fb0bd8 100644 --- a/redfish-core/include/query.hpp +++ b/redfish-core/include/query.hpp
@@ -68,6 +68,12 @@ // No If-Match header. Nothing to do return true; } + if (ifMatch == "*") + { + // Representing any resource + // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match + return true; + } if (req.req.method() != boost::beast::http::verb::patch && req.req.method() != boost::beast::http::verb::post && req.req.method() != boost::beast::http::verb::delete_)