fix: ignore empty Streamable HTTP JSON responses (#1626)
This commit is contained in:
parent
1f9b8a3955
commit
ffc557f920
1 changed files with 39 additions and 2 deletions
|
|
@ -186,7 +186,10 @@ internal sealed partial class StreamableHttpClientSessionTransport : TransportBa
|
|||
if (response.Content.Headers.ContentType?.MediaType == "application/json")
|
||||
{
|
||||
var responseContent = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
|
||||
rpcResponseOrError = await ProcessMessageAsync(responseContent, rpcRequest, cancellationToken).ConfigureAwait(false);
|
||||
if (responseContent.Length > 0)
|
||||
{
|
||||
rpcResponseOrError = await ProcessMessageAsync(responseContent, rpcRequest, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
else if (response.Content.Headers.ContentType?.MediaType == "text/event-stream")
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue