Skip to content
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
@rynowak

Description

@rynowak

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.

Metadata

Metadata

Assignees

Labels

3 - Donebugup-for-grabsMembers of our awesome commnity can handle this issue

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions