Cors is enabled in the web api at global level and is working fine locally, i am able to call it from any origin
but after hosting it on IIS 7.5 for testing , the cors policy again started poping up.
- public static void Register(HttpConfiguration config)
- {
-
-
-
- config.MapHttpAttributeRoutes();
- EnableCorsAttribute cors = new EnableCorsAttribute("*", "*", "*");
- config.EnableCors(cors);
- config.Routes.MapHttpRoute(
- name: "DefaultApi",
- routeTemplate: "api/{controller}/{id}",
- defaults: new { id = RouteParameter.Optional }
- );
-
- }
Does it need https to work?