From 4101dac9b2a212b95cef56fef278cae9ee4a174c Mon Sep 17 00:00:00 2001 From: ZverGuy Date: Wed, 4 Nov 2026 19:38:22 +0700 Subject: [PATCH] test(observability-proxy): pin gzip on non-tail log requests Only tails opt out of the transport's gzip negotiation; bounded requests keep it on purpose. Assert that side too, so a change that applies identity to every request fails a test instead of silently dropping compression between the proxy and the store. Assisted-by: LLM Signed-off-by: ZverGuy --- internal/observabilityproxy/server_test.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/internal/observabilityproxy/server_test.go b/internal/observabilityproxy/server_test.go index dc782d60d..fe3805961 100644 --- a/internal/observabilityproxy/server_test.go +++ b/internal/observabilityproxy/server_test.go @@ -215,6 +215,9 @@ func TestServerRebuildsUpstreamRequest(t *testing.T) { if r.headers.Get("AccountID") != "0" || r.headers.Get("ProjectID") != "0" { t.Errorf("tenant headers = %q/%q, want 0/0", r.headers.Get("AccountID"), r.headers.Get("ProjectID")) } + if ae := r.headers.Get("Accept-Encoding"); !strings.Contains(ae, "gzip") { + t.Errorf("upstream query Accept-Encoding = %q, want gzip outside tails", ae) + } for _, k := range []string{"Authorization", "X-Forwarded-For", "Cookie"} { if r.headers.Get(k) != "" { t.Errorf("client header %s forwarded", k) @@ -370,7 +373,11 @@ func TestServerTailHeadersBeforeFirstLine(t *testing.T) { case <-time.After(2 * time.Second): t.Fatal("tail response headers did not reach the client before the first line") } - if ae := h.requests()[0].headers.Get("Accept-Encoding"); ae != "identity" { + reqs := h.requests() + if len(reqs) != 1 { + t.Fatalf("upstream saw %d requests, want 1", len(reqs)) + } + if ae := reqs[0].headers.Get("Accept-Encoding"); ae != "identity" { t.Fatalf("upstream tail Accept-Encoding = %q, want identity", ae) } }