From 08d637269f6fd7f2e2751089d27f428c7e295f69 Mon Sep 17 00:00:00 2001 From: Rod Vagg Date: Thu, 24 Aug 2023 15:16:01 +1000 Subject: [PATCH] fix: adjust to new X-Ipfs-Path escaping --- pkg/internal/itest/trustless_fetch_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/internal/itest/trustless_fetch_test.go b/pkg/internal/itest/trustless_fetch_test.go index 67722c4b..a53f827d 100644 --- a/pkg/internal/itest/trustless_fetch_test.go +++ b/pkg/internal/itest/trustless_fetch_test.go @@ -15,6 +15,7 @@ import ( "github.com/filecoin-project/lassie/pkg/internal/itest/testpeer" "github.com/filecoin-project/lassie/pkg/lassie" httpserver "github.com/filecoin-project/lassie/pkg/server/http" + "github.com/filecoin-project/lassie/pkg/types" "github.com/google/uuid" "github.com/ipfs/go-unixfsnode" "github.com/ipld/go-car/v2" @@ -117,7 +118,7 @@ func TestTrustlessUnixfsFetch(t *testing.T) { etagGot := resp.Header.Get("ETag") req.True(strings.HasPrefix(etagGot, etagStart), "ETag should start with [%s], got [%s]", etagStart, etagGot) req.Equal(`"`, etagGot[len(etagGot)-1:], "ETag should end with a quote") - req.Equal(fmt.Sprintf("/ipfs/%s%s", tc.Root.String(), tc.Path), resp.Header.Get("X-Ipfs-Path")) + req.Equal(fmt.Sprintf("/ipfs/%s%s", tc.Root.String(), types.PathEscape(tc.Path)), resp.Header.Get("X-Ipfs-Path")) requestId := resp.Header.Get("X-Trace-Id") require.NotEmpty(t, requestId) _, err = uuid.Parse(requestId)