Skip to content

Commit 7e982de

Browse files
committed
fix staticcheck issue
1 parent c43a4b0 commit 7e982de

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

mcp/streamable.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,10 @@ func (c *streamableServerConn) servePOST(w http.ResponseWriter, req *http.Reques
585585
return
586586
}
587587
incoming, _, err := readBatch(body)
588+
if err != nil {
589+
http.Error(w, fmt.Sprintf("malformed payload: %v", err), http.StatusBadRequest)
590+
return
591+
}
588592
requests := make(map[jsonrpc.ID]struct{})
589593
tokenInfo := auth.TokenInfoFromContext(req.Context())
590594
for _, msg := range incoming {

0 commit comments

Comments
 (0)