File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/client Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import io.github.oshai.kotlinlogging.KotlinLogging
44import io.ktor.client.HttpClient
55import io.ktor.client.plugins.ClientRequestException
66import io.ktor.client.plugins.sse.ClientSSESession
7+ import io.ktor.client.plugins.sse.SSEClientException
78import io.ktor.client.plugins.sse.sseSession
89import io.ktor.client.request.HttpRequestBuilder
910import io.ktor.client.request.accept
@@ -229,8 +230,8 @@ public class StreamableHttpClientTransport(
229230 requestBuilder()
230231 }
231232 logger.debug { " Client SSE session started successfully." }
232- } catch (e: ClientRequestException ) {
233- if (e.response.status == HttpStatusCode .MethodNotAllowed ) {
233+ } catch (e: SSEClientException ) {
234+ if (e.response? .status == HttpStatusCode .MethodNotAllowed ) {
234235 logger.info { " Server returned 405 for GET/SSE, stream disabled." }
235236 return
236237 }
You can’t perform that action at this time.
0 commit comments