Compare commits
2 Commits
d8db786e27
...
v0.2.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f63605bdd0 | ||
|
|
c4d3735272 |
@@ -9,7 +9,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
ProtocolVersion = "2025-06-18"
|
||||
ProtocolVersion = "2025-03-26"
|
||||
maxRequestBodyBytes = 1 << 20 // 1 MiB
|
||||
)
|
||||
|
||||
@@ -111,11 +111,8 @@ func (s *Server) handlePOST(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
func (s *Server) handleGET(w http.ResponseWriter, r *http.Request) {
|
||||
sid := r.Header.Get("Mcp-Session-Id")
|
||||
if !s.opts.Sessions.Valid(sid) {
|
||||
http.Error(w, "missing or invalid Mcp-Session-Id", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
// Session ID is optional for GET: clients may open the SSE stream before
|
||||
// calling initialize (e.g. claude.ai probes on add). Accept with or without.
|
||||
w.Header().Set("Content-Type", "text/event-stream")
|
||||
w.Header().Set("Cache-Control", "no-cache")
|
||||
w.Header().Set("Connection", "keep-alive")
|
||||
|
||||
@@ -52,7 +52,7 @@ func TestInitialize(t *testing.T) {
|
||||
var resp map[string]any
|
||||
require.NoError(t, json.Unmarshal(rr.Body.Bytes(), &resp))
|
||||
result := resp["result"].(map[string]any)
|
||||
assert.Equal(t, "2025-06-18", result["protocolVersion"])
|
||||
assert.Equal(t, mcp.ProtocolVersion, result["protocolVersion"])
|
||||
si := result["serverInfo"].(map[string]any)
|
||||
assert.Equal(t, "gitea-mcp", si["name"])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user