Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Do not attempt to read from the stream if we have a ResponseWriter ca…
…llback.
  • Loading branch information
kendallb committed Apr 4, 2022
commit 51c860de8a9d21f0843ba6c9c1eabd4b4c45a70a
2 changes: 1 addition & 1 deletion src/RestSharp/Response/RestResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ async Task<RestResponse> GetDefaultResponse() {
await using var stream = await readTask.ConfigureAwait(false);
#endif

var bytes = stream == null ? null : await stream.ReadAsBytes(cancellationToken).ConfigureAwait(false);
var bytes = request.ResponseWriter != null || stream == null ? null : await stream.ReadAsBytes(cancellationToken).ConfigureAwait(false);
var content = bytes == null ? null : httpResponse.GetResponseString(bytes, encoding);

return new RestResponse {
Expand Down