Skip to content

Commit 6b9c30f

Browse files
committed
fix: message endpoint generate
1 parent 39ee6ec commit 6b9c30f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

server/sse.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,8 +496,12 @@ func (s *SSEServer) GetMessageEndpointForClient(r *http.Request, sessionID strin
496496
if s.useFullURLForMessageEndpoint && s.baseURL != "" {
497497
endpointPath = s.baseURL + endpointPath
498498
}
499-
500-
return fmt.Sprintf("%s?sessionId=%s", endpointPath, sessionID)
499+
if strings.Contains(endpointPath, "?") {
500+
endpointPath += "&"
501+
} else {
502+
endpointPath += "?"
503+
}
504+
return fmt.Sprintf("%ssessionId=%s", endpointPath, sessionID)
501505
}
502506

503507
// handleMessage processes incoming JSON-RPC messages from clients and sends responses

0 commit comments

Comments
 (0)