Skip to content

Commit

Permalink
Added missing lock (#1813)
Browse files Browse the repository at this point in the history
  • Loading branch information
BluMichele authored Jul 20, 2022
1 parent 7ed37da commit 2f476f8
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,14 @@ public static void VerifyUserHasAnyAcceptedScope(this HttpContext context, param
if (scopeClaim == null || !scopeClaim.Value.Split(' ').Intersect(acceptedScopes).Any())
{
string message = string.Format(CultureInfo.InvariantCulture, IDWebErrorMessage.MissingScopes, string.Join(",", acceptedScopes));

context.Response.StatusCode = (int)HttpStatusCode.Forbidden;
context.Response.WriteAsync(message);
context.Response.CompleteAsync();


lock (context)
{
context.Response.StatusCode = (int)HttpStatusCode.Forbidden;
context.Response.WriteAsync(message);
context.Response.CompleteAsync();
}

throw new UnauthorizedAccessException(message);
}
}
Expand Down

0 comments on commit 2f476f8

Please sign in to comment.