Skip to content

Commit

Permalink
test(plugin-htlc-coordinator-besu): fix HSTS header assert lowercase
Browse files Browse the repository at this point in the history
1. The test seem to have been broken from the moment of the introduction
of the HSTS header assertions.
2. The HSTS headers should be managed on the API server level instead of
individual endpoints.
3. I'll create a follow-up issue for working on this in a more generic
way that gets HSTS headers in place across the board and also in a way
that these are configurable for scenarios when the users don't want them.

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
  • Loading branch information
petermetz committed May 23, 2024
1 parent eeb34f9 commit ff13f6a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
1 change: 1 addition & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"hada",
"hashicorp",
"Healthcheck",
"HSTS",
"htlc",
"Htlc",
"HTLC",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,6 @@ test(testCase, async (t: Test) => {

const response = await htlcCoordinatorBesuApiClient.ownHtlcV1(ownHTLCRequest);
t.equal(response.status, 200, "response status is 200 OK");
t.equal(
response.headers["Strict-Transport-Security"],
"max-age=31536000; includeSubDomains; preload",
"response header is max-age=31536000; includeSubDomains; preload OK",
);
t.equal(response.data.success, true, "response success is true");
t.ok(
response.data,
Expand Down Expand Up @@ -300,8 +295,9 @@ test(testCase, async (t: Test) => {
counterpartyHTLCRequest,
);
t.equal(response2.status, 200, "response status is 200 OK");
const hstsHeader = response2.headers["strict-transport-security"];
t.equal(
response2.headers["Strict-Transport-Security"],
hstsHeader,
"max-age=31536000; includeSubDomains; preload",
"response header is max-age=31536000; includeSubDomains; preload OK",
);
Expand Down

0 comments on commit ff13f6a

Please sign in to comment.