From ff13f6a41ba3439d46f98e1423febfa56a4a0647 Mon Sep 17 00:00:00 2001 From: Peter Somogyvari Date: Sat, 18 May 2024 22:59:17 +0000 Subject: [PATCH] test(plugin-htlc-coordinator-besu): fix HSTS header assert lowercase 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 --- .cspell.json | 1 + .../counterparty-htlc-endpoint.test.ts | 8 ++------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.cspell.json b/.cspell.json index 22aecbaec8..54d4559034 100644 --- a/.cspell.json +++ b/.cspell.json @@ -81,6 +81,7 @@ "hada", "hashicorp", "Healthcheck", + "HSTS", "htlc", "Htlc", "HTLC", diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/test/typescript/integration/plugin-htlc-coordinator/counterparty-htlc-endpoint.test.ts b/extensions/cactus-plugin-htlc-coordinator-besu/src/test/typescript/integration/plugin-htlc-coordinator/counterparty-htlc-endpoint.test.ts index 6ccf709f72..2815325d73 100644 --- a/extensions/cactus-plugin-htlc-coordinator-besu/src/test/typescript/integration/plugin-htlc-coordinator/counterparty-htlc-endpoint.test.ts +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/test/typescript/integration/plugin-htlc-coordinator/counterparty-htlc-endpoint.test.ts @@ -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, @@ -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", );