Add CORS exception
This commit is contained in:
@ -103,4 +103,12 @@ app.MapControllers();
|
||||
// Add custom middlewares
|
||||
app.UseMiddleware<AddCustomClaimsMiddleware>();
|
||||
|
||||
app.UseCors(x => x
|
||||
.AllowAnyOrigin()
|
||||
.AllowAnyMethod()
|
||||
.AllowAnyHeader());
|
||||
|
||||
var webClientUrl = configuration.GetSection("WebClient").GetValue<string>("Url");
|
||||
app.UseCors(x => x.AllowAnyHeader().AllowAnyMethod().WithOrigins(webClientUrl));
|
||||
|
||||
app.Run();
|
||||
|
||||
@ -6,5 +6,7 @@
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
"WebClient": {
|
||||
"Url": "https://localhost:3000"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user