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 <maximbel2003@gmail.com>
This commit is contained in:
ZverGuy committed 2026-11-10 00:45:06 +07:00
1 parent e6e3466b7d
commit 4101dac9b2
1 file changed
+8 -1
+8 -1
View File
@@ -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)
}
}