From 6b63cacf14a89695b980e84b78372b473949966b Mon Sep 17 00:00:00 2001 From: Kharec Date: Thu, 13 Nov 2025 08:14:45 +0100 Subject: [PATCH] refactor: use assertHeaderContains helper for compression header checks --- .../compression_static_metadata_integration_test.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/integration/compression_static_metadata_integration_test.go b/internal/integration/compression_static_metadata_integration_test.go index 36d731e..82a1bf0 100644 --- a/internal/integration/compression_static_metadata_integration_test.go +++ b/internal/integration/compression_static_metadata_integration_test.go @@ -25,7 +25,9 @@ func TestIntegration_Compression(t *testing.T) { router.ServeHTTP(rec, req) - if rec.Header().Get("Content-Encoding") == "gzip" { + contentEncoding := rec.Header().Get("Content-Encoding") + if contentEncoding != "" && strings.Contains(contentEncoding, "gzip") { + assertHeaderContains(t, rec, "Content-Encoding", "gzip") reader, err := gzip.NewReader(rec.Body) if err != nil { t.Fatalf("Failed to create gzip reader: %v", err) @@ -52,7 +54,9 @@ func TestIntegration_Compression(t *testing.T) { router.ServeHTTP(rec, req) - if rec.Header().Get("Vary") == "" { + if rec.Header().Get("Vary") != "" { + assertHeaderContains(t, rec, "Vary", "Accept-Encoding") + } else { t.Log("Vary header may not always be present") } })