Skip to content

Commit

Permalink
fix SSEClientTransport endpoint process with none directory sse path
Browse files Browse the repository at this point in the history
  • Loading branch information
tpp-builder committed Feb 13, 2025
1 parent 98995ec commit cbb64bb
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/jvmTest/kotlin/client/SseTransportTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,31 @@ class SseTransportTest : BaseTransportTest() {
testClientRead(client)
server.stop()
}

@Test
fun `test sse path not root path`() = runTest {
val server = embeddedServer(CIO, port = PORT) {
install(io.ktor.server.sse.SSE)
routing {
mcpSseTransport(path = "/sse", incomingPath = "/messages") {
onMessage = {
send(it)
}
}
}
}.start(wait = false)

val client = HttpClient {
install(SSE)
}.mcpSseTransport {
url {
host = "localhost"
port = PORT
pathSegments = listOf("sse")
}
}

testClientRead(client)
server.stop()
}
}

0 comments on commit cbb64bb

Please sign in to comment.