Skip to content

Commit

Permalink
Save HttpStatusCode without CollectHttpResponseDetails
Browse files Browse the repository at this point in the history
  • Loading branch information
Katya Sokolova committed Jul 7, 2022
1 parent 83b6d43 commit 0713bd8
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,13 @@ public async Task ConnectAsync(Uri uri, CancellationToken cancellationToken, Cli
}
finally
{
if (options.CollectHttpResponseDetails && response != null)
if (response != null)
{
HttpStatusCode = response.StatusCode;
HttpResponseHeaders = new HttpResponseHeadersReadOnlyCollection(response.Headers);
if (options.CollectHttpResponseDetails)
{
HttpResponseHeaders = new HttpResponseHeadersReadOnlyCollection(response.Headers);
}
}

if (disposeResponse)
Expand Down

0 comments on commit 0713bd8

Please sign in to comment.