📅  最后修改于: 2022-03-11 14:58:53.907000             🧑  作者: Mango
app.UseExceptionHandler(appBuilder =>
{
appBuilder.Run(async context =>
{
context.Response.Headers.Add("Access-Control-Allow-Origin", "*"); // I needed to add this otherwise in Angular I Would get "Response with status: 0 for URL"
context.Response.StatusCode = 500;
await context.Response.WriteAsync("Internal Server Error");
});
});