Update StdioClientTransport.cs (#68)

This commit is contained in:
Clay Upton 2025-03-13 00:26:53 -05:00 • committed by GitHub
commit cdcf134e7a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -209,7 +209,8 @@ public sealed class StdioClientTransport : TransportBase, IClientTransport
private async Task ProcessMessageAsync(string line, CancellationToken cancellationToken)
{
try
{
{
line=line.Trim();//Fixes an error when the service prefixes nonprintable characters
var message = JsonSerializer.Deserialize<IJsonRpcMessage>(line, _jsonOptions);
if (message != null)
{
@ -296,4 +297,4 @@ public sealed class StdioClientTransport : TransportBase, IClientTransport
_logger.TransportCleanedUp(EndpointName);
}
}
}