3 changed files with 50 additions and 12 deletions
@ -0,0 +1,18 @@ |
|||||||
|
using Microsoft.AspNetCore.Mvc.Filters; |
||||||
|
|
||||||
|
namespace _24Hour.Model |
||||||
|
{ |
||||||
|
public class CustomCorsActionFilterAttribute : Attribute, IActionFilter |
||||||
|
{ |
||||||
|
|
||||||
|
public void OnActionExecuting(ActionExecutingContext context) |
||||||
|
{ |
||||||
|
context.HttpContext.Response.Headers.Add("Access-Control-Allow-Origin", "*"); |
||||||
|
} |
||||||
|
|
||||||
|
public void OnActionExecuted(ActionExecutedContext context) |
||||||
|
{ |
||||||
|
|
||||||
|
} |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue