From 61fc03dbad9349ab53800c1cb590f5def941ad8e Mon Sep 17 00:00:00 2001 From: "Artem.Bukhonov" Date: Fri, 5 Dec 2025 17:13:15 +0100 Subject: [PATCH] Properly check content type. Should fix #450 --- .../kotlin/sdk/server/SSEServerTransport.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kotlin-sdk-server/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/server/SSEServerTransport.kt b/kotlin-sdk-server/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/server/SSEServerTransport.kt index c662464d..1b33f39e 100644 --- a/kotlin-sdk-server/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/server/SSEServerTransport.kt +++ b/kotlin-sdk-server/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/server/SSEServerTransport.kt @@ -80,7 +80,7 @@ public class SseServerTransport(private val endpoint: String, private val sessio val body = try { val ct = call.request.contentType() - if (ct != ContentType.Application.Json) { + if (!ct.match(ContentType.Application.Json)) { error("Unsupported content-type: $ct") }