Created
August 6, 2013 19:24
-
-
Save ianbattersby/6167726 to your computer and use it in GitHub Desktop.
Owin CORS Hack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return WebApp.Start( | |
startOptions, | |
app => | |
{ | |
app.UseErrorPage(); | |
app.Use( | |
new Func<AppFunc, AppFunc>( | |
ignoreNextApp => (env => | |
{ | |
var responseHeaders = (IDictionary<string, string[]>)env["owin.ResponseHeaders"]; | |
responseHeaders.Add("Access-Control-Allow-Origin", new string[] { "*" }); | |
return simpleWeb.Invoke(env); | |
}))); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment