mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-11-10 05:48:19 +01:00
test(volume_server): expect 200 for HEAD with mismatched If-None-Match
The read handler evaluates If-None-Match before If-Modified-Since for both GET and HEAD, so a mismatched etag returns the full response, not 304.
This commit is contained in:
1 parent
65b92b654d
commit
717966a656
1 file changed
+2
-2
@@ -198,8 +198,8 @@ func TestConditionalHeaderPrecedenceAndInvalidIfModifiedSince(t *testing.T) {
|
||||
headIMSPrecedenceReq.Header.Set("If-None-Match", "\"definitely-different-etag\"")
|
||||
headIMSPrecedenceResp := framework.DoRequest(t, client, headIMSPrecedenceReq)
|
||||
headIMSPrecedenceBody := framework.ReadAllAndClose(t, headIMSPrecedenceResp)
|
||||
if headIMSPrecedenceResp.StatusCode != http.StatusNotModified {
|
||||
t.Fatalf("HEAD conditional precedence expected 304 when If-Modified-Since matches, got %d", headIMSPrecedenceResp.StatusCode)
|
||||
if headIMSPrecedenceResp.StatusCode != http.StatusOK {
|
||||
t.Fatalf("HEAD mismatched If-None-Match overrides If-Modified-Since: expected 200, got %d", headIMSPrecedenceResp.StatusCode)
|
||||
}
|
||||
if len(headIMSPrecedenceBody) != 0 {
|
||||
t.Fatalf("HEAD conditional precedence expected empty body, got %d bytes", len(headIMSPrecedenceBody))
|
||||
|
||||
Reference in new issue
Block a user