SignalR, ASP.NET 5 and CORS -


i'm trying use signalr mvc6 application, encounter problem cors.

first : if host index.html file on http://localhost:1234/index.html (same web app) it's working. when host elsewhere (for example in file:///c:/users/me/documents/index.html), have error :

no 'access-control-allow-origin' header present on requested resource. origin 'null' therefore not allowed access.

of course, try enable cors, startup file :

public class startup {     public void configureservices(iservicecollection services)     {         services.addmvc();         services.addsignalr();          services.addcors();         var policy = new microsoft.aspnet.cors.core.corspolicy();         policy.origins.add("*");         policy.headers.add("*");         policy.methods.add("*");         services.configurecors(x => x.addpolicy("allowall", policy));     }      public void configure(iapplicationbuilder app)     {         app.usecors("allowall");         app.usesignalr();         app.usemvc();     } } 

but now, have error :

a wildcard '*' cannot used in 'access-control-allow-origin' header when credentials flag true. origin 'null' therefore not allowed access.

then try :

policy.supportscredentials = false; 

but still getting same error.

what should ?

seen signalr team, working on http://localhost:port not on file:///c:/users/me/documents/index.html , normal.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -