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
|
|
@ -7,6 +7,7 @@ package mcp
|
|||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"crypto/rand"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
|
|
@ -216,7 +217,7 @@ func (h *SSEHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
|||
w.Header().Set("Cache-Control", "no-cache")
|
||||
w.Header().Set("Connection", "keep-alive")
|
||||
|
||||
sessionID = randText()
|
||||
sessionID = rand.Text()
|
||||
endpoint, err := req.URL.Parse("?sessionid=" + sessionID)
|
||||
if err != nil {
|
||||
http.Error(w, "internal error: failed to create endpoint", http.StatusInternalServerError)
|
||||
|
|
|
|||
Loading…
Reference in a new issue