Skip to content

Commit

Permalink
Merge pull request #7 from tpavlacky/ConfigureAwait
Browse files Browse the repository at this point in the history
Added ConfigureAwait(false) to all await calls to prevent deadlock
  • Loading branch information
bernardbr authored Apr 13, 2022
2 parents 48dbb34 + a51ffdb commit b734115
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/DigestAuthenticator/DigestAuthenticator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public async ValueTask Authenticate(RestClient client, RestRequest request)
{
var uri = client.BuildUri(request);
var manager = new DigestAuthenticatorManager(client.BuildUri(new RestRequest()), _username, _password, Timeout);
await manager.GetDigestAuthHeader(uri.PathAndQuery, request.Method);
await manager.GetDigestAuthHeader(uri.PathAndQuery, request.Method).ConfigureAwait(false);
var digestHeader = manager.GetDigestHeader(uri.PathAndQuery, request.Method);
request.AddOrUpdateHeader("Connection", "Keep-Alive");
request.AddOrUpdateHeader(KnownHeaders.Authorization, digestHeader);
Expand Down
2 changes: 1 addition & 1 deletion src/DigestAuthenticator/DigestAuthenticatorManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public async Task GetDigestAuthHeader(string path, Method method)
request.AddOrUpdateHeader("Accept-Encoding", "gzip, deflate, br");
request.Timeout = _timeout;
using var client = new RestClient();
var response = await client.ExecuteAsync(request);
var response = await client.ExecuteAsync(request).ConfigureAwait(false);
GetDigestDataFromFailResponse(response);
}

Expand Down

0 comments on commit b734115

Please sign in to comment.