Skip to content

Commit 091c264

Browse files
committed
Trying different way of enabling cors.
1 parent 0a933b0 commit 091c264

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

eFormAPI/eFormAPI/App_Start/WebApiConfig.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Net.Http.Headers;
55
using System.Reflection;
66
using System.Web.Http;
7+
using System.Web.Http.Cors;
78
using System.Web.Http.Dispatcher;
89
using Autofac.Integration.WebApi;
910
using eFormAPI.Web.Infrastructure.Helpers;
@@ -20,7 +21,8 @@ public static void Register(HttpConfiguration config)
2021
{
2122
// Web API configuration and services
2223
// Configure Web API to use only bearer token authentication.
23-
config.EnableCors();
24+
var corsAttr = new EnableCorsAttribute("*", "*", "*");
25+
config.EnableCors(corsAttr);
2426
config.SuppressDefaultHostAuthentication();
2527
config.Filters.Add(new HostAuthenticationFilter(OAuthDefaults.AuthenticationType));
2628
config.Filters.Add(new HostAuthenticationFilter(CookieAuthenticationDefaults.AuthenticationType));

0 commit comments

Comments
 (0)