Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Create advanced CORS middleware for specific CORS policy support #2072

Closed
DamianEdwards opened this Issue May 21, 2013 · 7 comments

Comments

Projects
None yet
4 participants
Owner

DamianEdwards commented May 21, 2013

Create OWIN middleware that uses the new Web API CORS support (System.Web.Cors) so that users requiring more advanced CORS support, including locking down origin domains to specific values, can do so.

@ghost ghost assigned davidfowl Jul 5, 2013

Owner

davidfowl commented Jul 5, 2013

Gonna do this for 2.0 rc

app.MapConnection<RawConnection>("/raw-connection",
    new ConnnectionConfiguration { EnableCrossDomain = true });



app.Map("/raw-connection", map =>
    map.UseCors(CorsOptions.AllowAll)
       .UseConnection<RawConnection>()
);



public void Configuration(IAppBuilder app)
{
    app.Map("/raw-connection", ConfigureRawConnection);
    app.Map("/api", ConfigureWebApi);
    app.Map("/nancy", ConfigureNancy);
}

private void ConfigureRawConnection(IAppBuilder map)
{
    map.UseCors(CorsOptions.AllowAll);
    map.UseConnection<RawConnection>();
}

@ghost ghost assigned Xiaohongt Jul 18, 2013

Contributor

Xiaohongt commented Jul 20, 2013

Do we want to remove ConnectionConfiguration in SignalR.Core? ConnectionConfiguration seems become not necessary now.

Owner

davidfowl commented Jul 20, 2013

No, we want to be future proof incase we add any new configuration options in the future.

Contributor

Xiaohongt commented Jul 20, 2013

When not UseCors in Owin Cors middleware, but now corss-origin can work if use jsonp

Owner

davidfowl commented Jul 21, 2013

Jsonp is separate from this issue. We're going to disable JSONP by default by adding a new flag. We had to do some research beforing coming to this decision but that has nothing to do with this issue.

Contributor

Xiaohongt commented Jul 23, 2013

verified cross-origin for hub connection and persistent connection with all transports

@Xiaohongt Xiaohongt closed this Jul 23, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment