Skip to content

Commit 917d77f

Browse files
authored
Fix server test that breaks with go.1.26 (#2789)
1 parent 305114c commit 917d77f

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

server/find/server_test.go

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,23 @@ func TestServer_CORSWithExpectedContentType(t *testing.T) {
110110
wantContentType: "application/json",
111111
statusCode: http.StatusBadRequest,
112112
},
113+
/*
114+
// This test works in go1.25 becuase there is no handler for
115+
// `/multihash` (no trailing slash). This test fails in go1.26 because
116+
// the request for `/multihash` is redirected to the handler for
117+
// `/multihash/` which checks the method.
118+
{
119+
reqMethod: http.MethodPost,
120+
reqUrl: "/multihash",
121+
wantContentType: "application/json",
122+
statusCode: http.StatusBadRequest,
123+
},
124+
*/
113125
{
114126
reqMethod: http.MethodPost,
115-
reqUrl: "/multihash",
127+
reqUrl: "/multihash/",
116128
wantContentType: "application/json",
117-
statusCode: http.StatusBadRequest,
129+
statusCode: http.StatusMethodNotAllowed,
118130
},
119131
{
120132
reqMethod: http.MethodGet,

0 commit comments

Comments
 (0)