Created
February 16, 2019 11:36
-
-
Save evan-boissonnot/d624ae4dc4fb45db822df48ae3fe9cd8 to your computer and use it in GitHub Desktop.
AllowSpecificOrigin Cors asp.net core
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
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