mirror of
https://github.com/JKorf/CryptoExchange.Net.git
synced 2026-08-18 11:52:54 +00:00
Added check for invalid json in JsonSocketMessageHandler and virtual GetTypeIdentifierNonJson for handling non-json messages
This commit is contained in:
@@ -439,6 +439,10 @@ namespace CryptoExchange.Net.Clients
|
||||
var outputOriginalData = ApiOptions.OutputOriginalData ?? ClientOptions.OutputOriginalData;
|
||||
if (outputOriginalData || MessageHandler.RequiresSeekableStream || !response.IsSuccessStatusCode)
|
||||
{
|
||||
// Create a seekable stream from the response stream if:
|
||||
// 1. We need to output the original data
|
||||
// 2. The message handler requires a seekable stream
|
||||
// 3. The response indicates error and we want to output (part of) the returned data
|
||||
responseStream = await CopyStreamAsync(responseStream).ConfigureAwait(false);
|
||||
using var reader = new StreamReader(responseStream, Encoding.UTF8, false, 4096, true);
|
||||
if (outputOriginalData)
|
||||
|
||||
Reference in New Issue
Block a user