File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/client Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -207,6 +207,7 @@ public class StreamableHttpClientTransport(
207207 }
208208
209209 sessionId = null
210+ lastEventId = null
210211 logger.debug { " Session terminated successfully" }
211212 }
212213
@@ -247,6 +248,7 @@ public class StreamableHttpClientTransport(
247248
248249 private fun applyCommonHeaders (builder : HttpRequestBuilder ) {
249250 builder.headers {
251+ append(HttpHeaders .Accept , ContentType .Application .Json .toString())
250252 sessionId?.let { append(MCP_SESSION_ID_HEADER , it) }
251253 protocolVersion?.let { append(MCP_PROTOCOL_VERSION_HEADER , it) }
252254 }
@@ -330,9 +332,9 @@ public class StreamableHttpClientTransport(
330332 continue
331333 }
332334 when {
333- line.startsWith(" id:" ) -> line.substring( 3 ).trim()
334- line.startsWith(" event:" ) -> eventName = line.substring( 6 ).trim()
335- line.startsWith(" data:" ) -> sb.append (line.substring( 5 ).trim())
335+ line.startsWith(" id:" ) -> id = line.substringAfter( " id: " ).trim()
336+ line.startsWith(" event:" ) -> eventName = line.substringAfter( " event: " ).trim()
337+ line.startsWith(" data:" ) -> sb.appendLine (line.substringAfter( " data: " ).trim())
336338 }
337339 }
338340 }
You can’t perform that action at this time.
0 commit comments