Skip to content

Commit 51ffe02

Browse files
committed
fix: message endpoint generate
1 parent c7e9b30 commit 51ffe02

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
@@ -473,8 +473,12 @@ func (s *SSEServer) GetMessageEndpointForClient(r *http.Request, sessionID strin
473473
if s.useFullURLForMessageEndpoint && s.baseURL != "" {
474474
endpointPath = s.baseURL + endpointPath
475475
}
476-
477-
return fmt.Sprintf("%s?sessionId=%s", endpointPath, sessionID)
476+
if strings.Contains(endpointPath, "?") {
477+
endpointPath += "&"
478+
} else {
479+
endpointPath += "?"
480+
}
481+
return fmt.Sprintf("%ssessionId=%s", endpointPath, sessionID)
478482
}
479483

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

0 commit comments

Comments
 (0)