mcp: use rand.Text and slog.DiscardHandler over internal implementation (#773)
Address TODOs in code requiring go 1.24 as minimum version mcp/logging.go: use slog.DiscardHandler, over local implementation mcp/util.go: use rand.Text, over local implementation Fixes #772
This commit is contained in:
parent
cf88bda0c5
commit
df4f0d56a4
1 changed files with 10 additions and 44 deletions
|
|
@ -11,6 +11,7 @@ package mcp
|
|||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
crand "crypto/rand"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
|
@ -1140,7 +1141,7 @@ func (c *streamableServerConn) servePOST(w http.ResponseWriter, req *http.Reques
|
|||
// Important: don't publish the incoming messages until the stream is
|
||||
// registered, as the server may attempt to respond to imcoming messages as
|
||||
// soon as they're published.
|
||||
stream, err := c.newStream(req.Context(), calls, randText())
|
||||
stream, err := c.newStream(req.Context(), calls, crand.Text())
|
||||
if err != nil {
|
||||
http.Error(w, fmt.Sprintf("storing stream: %v", err), http.StatusInternalServerError)
|
||||
return
|
||||
|
|
|
|||
Loading…
Reference in a new issue