diff --git a/APIMatic.Core/ApiCall.cs b/APIMatic.Core/ApiCall.cs index aaf71b43..0ef4dc0d 100644 --- a/APIMatic.Core/ApiCall.cs +++ b/APIMatic.Core/ApiCall.cs @@ -102,7 +102,7 @@ public ApiCall ExecuteAsync(CancellationToken cancellationToken = default) { requestBuilder.AcceptHeader = responseHandler.AcceptHeader; - CoreRequest request = await requestBuilder.Build(); + CoreRequest request = await requestBuilder.Build().ConfigureAwait(false); globalConfiguration.ApiCallback?.OnBeforeHttpRequestEventHandler(request); _sdkLogger.LogRequest(request); CoreResponse response = await globalConfiguration.HttpClient.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); diff --git a/APIMatic.Core/Authentication/AuthGroupBuilder.cs b/APIMatic.Core/Authentication/AuthGroupBuilder.cs index 5a84e668..9913b4b7 100644 --- a/APIMatic.Core/Authentication/AuthGroupBuilder.cs +++ b/APIMatic.Core/Authentication/AuthGroupBuilder.cs @@ -118,7 +118,7 @@ public override async Task Apply(RequestBuilder requestBuilder) Validate(); foreach (var authManager in validatedAuthManagers) { - await authManager.Apply(requestBuilder); + await authManager.Apply(requestBuilder).ConfigureAwait(false); } } } diff --git a/APIMatic.Core/Http/HttpClientWrapper.cs b/APIMatic.Core/Http/HttpClientWrapper.cs index cfc6a990..020e85b3 100644 --- a/APIMatic.Core/Http/HttpClientWrapper.cs +++ b/APIMatic.Core/Http/HttpClientWrapper.cs @@ -74,7 +74,7 @@ public async Task ExecuteAsync(CoreRequest request, CancellationTo if (_overrideHttpClientConfiguration) { responseMessage = await GetCombinedPolicy(request.RetryOption).ExecuteAsync( - async (cancellation) => await ExecuteHttpRequest(request, cancellation).ConfigureAwait(false), cancellationToken) + async (cancellation) => await ExecuteHttpRequest(request, cancellation).ConfigureAwait(false), cancellationToken, false) .ConfigureAwait(false); } else @@ -286,7 +286,7 @@ private AsyncRetryPolicy GetRetryPolicy(RetryOption retryOp GetServerWaitDuration(result).TotalMilliseconds)), onRetryAsync: async (result, timespan, retryAttempt, context) => { - await Task.CompletedTask; + await Task.CompletedTask.ConfigureAwait(false); }); private AsyncTimeoutPolicy GetTimeoutPolicy() diff --git a/APIMatic.Core/Request/RequestBuilder.cs b/APIMatic.Core/Request/RequestBuilder.cs index 6f394cef..33803672 100644 --- a/APIMatic.Core/Request/RequestBuilder.cs +++ b/APIMatic.Core/Request/RequestBuilder.cs @@ -150,7 +150,7 @@ public async Task Build() { parameters.Validate().Apply(this); configuration.RuntimeParameters.Validate().Apply(this); - await authGroup.Apply(this); + await authGroup.Apply(this).ConfigureAwait(false); CoreHelper.AppendUrlWithQueryParameters(QueryUrl, queryParameters, ArraySerialization); body = bodyParameters.Any() ? bodyParameters : body; AppendContentTypeHeader();