1
0

Optimizing async tasks (ConfigureAwait(false))

This commit is contained in:
2023-11-03 10:12:30 +01:00
parent 18b9627ea4
commit ca76966827
11 changed files with 61 additions and 43 deletions

View File

@@ -51,14 +51,14 @@ namespace AMWD.Common.AspNetCore.Security.BasicAuthentication
string username = plain.Split(':').First();
string password = plain[(username.Length + 1)..];
var principal = await validator.ValidateAsync(username, password, httpContext.GetRemoteIpAddress(), httpContext.RequestAborted);
var principal = await validator.ValidateAsync(username, password, httpContext.GetRemoteIpAddress(), httpContext.RequestAborted).ConfigureAwait(false);
if (principal == null)
{
SetAuthenticateRequest(httpContext, validator.Realm);
return;
}
await next.Invoke(httpContext);
await next.Invoke(httpContext).ConfigureAwait(false);
}
catch (Exception ex)
{