Optimizing async tasks (ConfigureAwait(false))
This commit is contained in:
@@ -37,14 +37,14 @@ namespace AMWD.Common.AspNetCore.Security.PathProtection
|
||||
{
|
||||
if (httpContext.Request.Path.StartsWithSegments(path))
|
||||
{
|
||||
var result = await authorizationService.AuthorizeAsync(httpContext.User, null, policyName);
|
||||
var result = await authorizationService.AuthorizeAsync(httpContext.User, null, policyName).ConfigureAwait(false);
|
||||
if (!result.Succeeded)
|
||||
{
|
||||
await httpContext.ChallengeAsync();
|
||||
await httpContext.ChallengeAsync().ConfigureAwait(false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
await next.Invoke(httpContext);
|
||||
await next.Invoke(httpContext).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user