summaryrefslogtreecommitdiff
path: root/test/redfish-core
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2023-06-06 23:37:03 +0300
committerEd Tanous <ed@tanous.net>2023-06-09 22:14:04 +0300
commit994fd86a3f6649a820f66313765e85e762ad105a (patch)
tree735fd2c3b5094568115c62f563e1356858c94ddd /test/redfish-core
parent08bbe1199f02d09f908cd3adcf4329e4bd67fd52 (diff)
downloadbmcweb-994fd86a3f6649a820f66313765e85e762ad105a.tar.xz
Fix hack on Set-Cookie
This is one that I couldn't figure out for a while. Turns out that fields has both a set() and an insert() method. Whereas set() replaces, insert() appends, which is what we want in this case. This allows us to call the actual methods several times, instead of essentially string injecting our own code, which should make it clearer. At the same time, there was one unit test that was structured such that it was using addHeader to clear a header, so this commit adds an explicit "clearHeader()" method, so we can be explicit. Tested: Logging into the webui in chrome (which uses POST /login) shows: 401 with no cookie header if the incorrect password is used 200 with 2 Set-Cookie headers set: Set-Cookie: SESSION=<session tag>; SameSite=Strict; Secure; HttpOnly Set-Cookie: XSRF-TOKEN=<token tag>; SameSite=Strict; Secure Change-Id: I9b87a48ea6ba892fc08e66940563dea86edb9a65 Signed-off-by: Ed Tanous <edtanous@google.com>
Diffstat (limited to 'test/redfish-core')
-rw-r--r--test/redfish-core/include/redfish_aggregator_test.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/redfish-core/include/redfish_aggregator_test.cpp b/test/redfish-core/include/redfish_aggregator_test.cpp
index 055d1371cd..83e4b4ec23 100644
--- a/test/redfish-core/include/redfish_aggregator_test.cpp
+++ b/test/redfish-core/include/redfish_aggregator_test.cpp
@@ -438,7 +438,7 @@ TEST(processCollectionResponse, satelliteWrongContentHeader)
convertToSat(resp);
// Ignore the satellite even though otherwise valid
- resp.addHeader("Content-Type", "");
+ resp.clearHeader(boost::beast::http::field::content_type);
RedfishAggregator::processCollectionResponse("prefix", asyncResp, resp);
EXPECT_EQ(asyncResp->res.getHeaderValue("OData-Version"), "4.0");