From 216c1032e6d822a50e7b98f85bb449777ddbe2d6 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 24 Oct 2026 15:06:19 -0700 Subject: [PATCH] test: mismatched If-None-Match serves the object over If-Modified-Since (#12045) The precedence case asserted the old If-Modified-Since-first ordering and expected 304. The volume servers now evaluate If-None-Match first, so a non-matching tag must return 200 with the body even when If-Modified-Since would allow 304 (RFC 9110 13.1.3). --- test/volume_server/http/read_path_variants_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/volume_server/http/read_path_variants_test.go b/test/volume_server/http/read_path_variants_test.go index eac72079a9..a997080d36 100644 --- a/test/volume_server/http/read_path_variants_test.go +++ b/test/volume_server/http/read_path_variants_test.go @@ -170,11 +170,11 @@ func TestConditionalHeaderPrecedenceAndInvalidIfModifiedSince(t *testing.T) { precedenceReq.Header.Set("If-None-Match", "\"definitely-different-etag\"") precedenceResp := framework.DoRequest(t, client, precedenceReq) precedenceBody := framework.ReadAllAndClose(t, precedenceResp) - if precedenceResp.StatusCode != http.StatusNotModified { - t.Fatalf("conditional precedence expected 304, got %d", precedenceResp.StatusCode) + if precedenceResp.StatusCode != http.StatusOK { + t.Fatalf("mismatched If-None-Match overrides If-Modified-Since: expected 200, got %d", precedenceResp.StatusCode) } - if len(precedenceBody) != 0 { - t.Fatalf("conditional precedence expected empty body, got %d bytes", len(precedenceBody)) + if string(precedenceBody) != string(payload) { + t.Fatalf("mismatched If-None-Match body mismatch: got %q want %q", string(precedenceBody), string(payload)) } invalidIMSReq := mustNewRequest(t, http.MethodGet, clusterHarness.VolumeAdminURL()+"/"+fid)