This repository was archived by the owner on Dec 14, 2018. It is now read-only.
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
CORS filter should throw when policy is not found #4606
Closed
Description
Use [EnableCors("foo")]
without defining any policies.
System.ArgumentNullException: Value cannot be null.
Parameter name: policy
at Microsoft.AspNetCore.Cors.Infrastructure.CorsService.EvaluatePolicy(HttpContext context, CorsPolicy policy)
at Microsoft.AspNetCore.Mvc.Cors.CorsAuthorizationFilter.<OnAuthorizationAsync>d__9.MoveNext()
We just let it nullref, we should throw a better exception.