From d539c9697fc4e82c91e37ac40b8170395f98943a Mon Sep 17 00:00:00 2001 From: Artem Bukhonov Date: Mon, 8 Dec 2025 17:10:39 +0100 Subject: [PATCH] Properly check content type. Should fix #450 (#451) ## Motivation and Context ## How Has This Been Tested? ## Breaking Changes ## Types of changes - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update ## Checklist - [ ] I have read the [MCP Documentation](https://modelcontextprotocol.io) - [ ] My code follows the repository's style guidelines - [ ] New and existing tests pass locally - [ ] I have added appropriate error handling - [ ] I have added or updated documentation as needed ## Additional context --- .../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 c662464..1b33f39 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") }