mcp: refactor streamable handler control flow (#949)

This commit is contained in:
Maciej Kisiel 2026-05-08 14:29:01 +02:00 • committed by GitHub
commit 9f5e89fea2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2428,13 +2428,13 @@ func TestStreamable405AllowHeader(t *testing.T) {
wantAllow: "POST",
},
{
// DELETE without session returns 400 Bad Request (not 405)
// because DELETE is a valid method, just requires a session ID.
// In stateless mode, only POST is supported.
// DELETE returns 405, consistent with Allow: POST.
name: "DELETE without session stateless",
stateless: true,
method: "DELETE",
wantStatus: http.StatusBadRequest,
wantAllow: "", // No Allow header for 400 responses
wantStatus: http.StatusMethodNotAllowed,
wantAllow: "POST",
},
}