Hi,
Is it correct that this code…
public override void Configure(IAppHost appHost)
{
var allowedOrigins = _appSettings.GetList("AllowedOrigins") ?? new[] {"*"}; //<add key="AllowedOrigins" value="http://localhost,http://locahost:3000"/>
appHost.Plugins.Add(new PostmanFeature());
appHost.Plugins.Add(new CorsFeature(
allowOriginWhitelist: allowedOrigins,
allowedMethods: "GET, POST, PUT, DELETE, OPTIONS",
allowCredentials: true,
allowedHeaders: "Authorization, Content-Type")); //Access-Control-Allow-Headers, X-Requested-With, Accept,
}
should produce these headers (on version 4.0.54)?
Access-Control-Allow-Credentials:true
Access-Control-Allow-Headers:Authorization, Content-Type
Access-Control-Allow-Methods:GET, POST, PUT, DELETE, OPTIONS
Content-Type:application/json
Date:Fri, 01 Apr 2016 13:23:44 GMT
Server:Microsoft-HTTPAPI/2.0
Transfer-Encoding:chunked
Vary:Accept
X-Powered-By:ServiceStack/4.054 Win32NT/.NET
I’m getting an exception in my AngularJS app on Chrome:
XMLHttpRequest cannot load http://localhost:8088/auth/currentSession. No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://localhost:3000’ is therefore not allowed access.
Any help appreciated…?