Skip to content

Instantly share code, notes, and snippets.

@evan-boissonnot
Created February 16, 2019 11:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evan-boissonnot/d624ae4dc4fb45db822df48ae3fe9cd8 to your computer and use it in GitHub Desktop.
Save evan-boissonnot/d624ae4dc4fb45db822df48ae3fe9cd8 to your computer and use it in GitHub Desktop.
AllowSpecificOrigin Cors asp.net core
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseCors("AllowSpecificOrigin");
app.UseMvc();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment