Resolved BugFix #993 (#996)

This commit is contained in:
Anderson de Paiva 2019-09-23 16:33:37 +01:00 committed by Thiago Loureiro
parent 88f31966d4
commit c8a2144a4b

View File

@ -25,7 +25,7 @@
public async Task Invoke(DownstreamContext context) public async Task Invoke(DownstreamContext context)
{ {
if (IsAuthenticatedRoute(context.DownstreamReRoute)) if (!IsOptionsHttpMethod(context) && IsAuthenticatedRoute(context.DownstreamReRoute))
{ {
Logger.LogInformation("route is authenticated scopes must be checked"); Logger.LogInformation("route is authenticated scopes must be checked");
@ -52,7 +52,7 @@
} }
} }
if (IsAuthorisedRoute(context.DownstreamReRoute)) if (!IsOptionsHttpMethod(context) && IsAuthorisedRoute(context.DownstreamReRoute))
{ {
Logger.LogInformation("route is authorised"); Logger.LogInformation("route is authorised");
@ -99,5 +99,10 @@
{ {
return reRoute.IsAuthorised; return reRoute.IsAuthorised;
} }
private static bool IsOptionsHttpMethod(DownstreamContext context)
{
return context.HttpContext.Request.Method.ToUpper() == "OPTIONS";
}
} }
} }