diff --git a/backend/cover_test.go b/backend/cover_test.go index 9c3c93f..87db88a 100644 --- a/backend/cover_test.go +++ b/backend/cover_test.go @@ -32,7 +32,7 @@ func TestPublicCoverServesStoredBytesUnauthenticated(t *testing.T) { // The wire URL is what a client actually requests, so the path under test // is taken from it rather than rebuilt by hand. - wire := st.CoverWireURL(store.CoverAddress(sourceURL)) + wire := st.CoverWireURL(store.CoverAddressForBytes([]byte("\x00webp-bytes"))) path, ok := strings.CutPrefix(wire, testCoverBaseURL) if !ok { t.Fatalf("wire URL %q is not on the public origin %q", wire, testCoverBaseURL) @@ -57,7 +57,7 @@ func TestPublicCoverServesStoredBytesUnauthenticated(t *testing.T) { func TestPublicCoverRejectsUnknownAddress(t *testing.T) { srv, _ := newWebTestServer(t, testConfig()) cases := map[string]string{ - "unknown": "/covers/" + store.CoverAddress("https://cdn.example/never-stored.jpg"), + "unknown": "/covers/" + store.CoverAddressForBytes([]byte("never-stored")), "malformed": "/covers/not-an-address", "traversal": "/covers/../../etc/passwd", "empty": "/covers/", @@ -86,7 +86,7 @@ func TestPublicCoverNeverEchoesNonImage(t *testing.T) { } // A legitimate row, then the content type flipped behind the store's back: // the bytes exist at the address, so only the type is hostile. - address := store.CoverAddress(sourceURL) + address := store.CoverAddressForBytes([]byte("