From 9d546885a8858228bf7b510a18dd30831f6a034a Mon Sep 17 00:00:00 2001 From: Luca <37640802+lucapivato@users.noreply.github.com> Date: Wed, 2 Jul 2025 11:00:56 +0200 Subject: [PATCH] Fixed StreamableHttpClientSessionTransport.cs for netstandard Fixed exception 'The format of value 'application/json; charset=utf-8' is invalid "application/json; charset=utf-8" is an invalid header. the correct one is "application/json". --- .../Client/StreamableHttpClientSessionTransport.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ModelContextProtocol.Core/Client/StreamableHttpClientSessionTransport.cs b/src/ModelContextProtocol.Core/Client/StreamableHttpClientSessionTransport.cs index 14df5c35..78217868 100644 --- a/src/ModelContextProtocol.Core/Client/StreamableHttpClientSessionTransport.cs +++ b/src/ModelContextProtocol.Core/Client/StreamableHttpClientSessionTransport.cs @@ -75,7 +75,7 @@ internal async Task SendHttpRequestAsync(JsonRpcMessage mes using var content = new StringContent( JsonSerializer.Serialize(message, McpJsonUtilities.JsonContext.Default.JsonRpcMessage), Encoding.UTF8, - "application/json; charset=utf-8" + "application/json" ); #endif @@ -310,4 +310,4 @@ internal static void CopyAdditionalHeaders( } } } -} \ No newline at end of file +}