Skip to content

Commit 472d488

Browse files
committed
fix etag test value
1 parent 7f6fc40 commit 472d488

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pkg/internal/itest/http_fetch_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,7 @@ func verifyHeaders(t *testing.T, resp response, root cid.Cid, path string, expec
11071107
req.Contains(st, "retrieval-")
11081108
req.Contains(st, "dur=") // at lest one of these
11091109
etagStart := fmt.Sprintf(`"%s.car.`, root.String())
1110-
etagGot := resp.Header.Get("ETag")
1110+
etagGot := strings.TrimPrefix(resp.Header.Get("ETag"), "W/")
11111111
req.True(strings.HasPrefix(etagGot, etagStart), "ETag should start with [%s], got [%s]", etagStart, etagGot)
11121112
req.Equal(`"`, etagGot[len(etagGot)-1:], "ETag should end with a quote")
11131113
req.Equal(fmt.Sprintf("/ipfs/%s%s", root.String(), path), resp.Header.Get("X-Ipfs-Path"))

pkg/internal/itest/trustless_fetch_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func TestTrustlessUnixfsFetch(t *testing.T) {
116116
req.Equal("application/vnd.ipld.car;version=1;order=dfs;dups=y", resp.Header.Get("Content-Type"))
117117
req.Equal("nosniff", resp.Header.Get("X-Content-Type-Options"))
118118
etagStart := fmt.Sprintf(`"%s.car.`, tc.Root.String())
119-
etagGot := resp.Header.Get("ETag")
119+
etagGot := strings.TrimPrefix(resp.Header.Get("ETag"), "W/")
120120
req.True(strings.HasPrefix(etagGot, etagStart), "ETag should start with [%s], got [%s]", etagStart, etagGot)
121121
req.Equal(`"`, etagGot[len(etagGot)-1:], "ETag should end with a quote")
122122
req.Equal(fmt.Sprintf("/ipfs/%s%s", tc.Root.String(), trustlessutils.PathEscape(tc.Path)), resp.Header.Get("X-Ipfs-Path"))

0 commit comments

Comments
 (0)