Skip to content

Instantly share code, notes, and snippets.

@beyond-code-github
Created March 14, 2013 14:34
Show Gist options
  • Save beyond-code-github/5161831 to your computer and use it in GitHub Desktop.
Save beyond-code-github/5161831 to your computer and use it in GitHub Desktop.
public static void RegisterCors(HttpConfiguration httpConfiguration)
{
WebApiCorsConfiguration corsConfig = new WebApiCorsConfiguration();
corsConfig.RegisterGlobal(httpConfiguration);
corsConfig.ForAllOrigins().AllowMethods("GET", "POST", "PUT", "PATCH", "DELETE").AllowAllRequestHeaders();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment