Skip to content

Commit

Permalink
ReceiveData was null when httpclient response is chunked.
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiamurialdo committed Jun 26, 2023
1 parent 21752ba commit 14c0a52
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions dotnet/src/dotnetframework/GxClasses/Domain/GxHttpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,14 @@ internal byte[] ReceiveData
{
get
{
if (_chunkedResponse && _receiveData == null && _receiveStream!=null)
{
using (MemoryStream memstream = new MemoryStream())
{
_receiveStream.BaseStream.CopyTo(memstream);
_receiveData = memstream.ToArray();
}
}
return _receiveData;
}
}
Expand Down Expand Up @@ -739,6 +747,7 @@ void ReadReponseContent(HttpResponseMessage response)
_encoding = Encoding.UTF8;

_receiveStream = new StreamReader(stream, _encoding);
_receiveData = null;
}
else
{
Expand Down Expand Up @@ -1520,6 +1529,7 @@ protected virtual void Dispose(bool disposing)
{
_receiveData = null;
_sendStream?.Dispose();
_receiveStream?.Dispose();
}
disposedValue = true;
}
Expand Down

0 comments on commit 14c0a52

Please sign in to comment.