From 32eeb76ee91f121292799bf251122a9efffdb281 Mon Sep 17 00:00:00 2001 From: Kharec Date: Thu, 13 Nov 2025 08:17:11 +0100 Subject: [PATCH] fix: check for empty header in assertHeader() --- internal/integration/helpers.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/integration/helpers.go b/internal/integration/helpers.go index 337e155..2d79c05 100644 --- a/internal/integration/helpers.go +++ b/internal/integration/helpers.go @@ -379,7 +379,11 @@ func assertCookieCleared(t *testing.T, rec *httptest.ResponseRecorder, name stri func assertHeader(t *testing.T, rec *httptest.ResponseRecorder, name, expectedValue string) { t.Helper() actualValue := rec.Header().Get(name) - if actualValue != expectedValue { + if expectedValue == "" { + if actualValue == "" { + t.Errorf("Expected header %s to be present", name) + } + } else if actualValue != expectedValue { t.Errorf("Expected header %s=%s, got %s", name, expectedValue, actualValue) } }