Closed mikebridge closed 6 years ago
You'll need to call .UseCors(...
before app.UseExceptionHandler().WithConventions(...
, could you just confirm this is the case.
Same problem here, Cors will remove the response. See: https://github.com/aspnet/CORS/issues/90
Nice find. There's a workaround in that issue where you can add a MaintainCorsHeader
middleware to restore the headers that are removed, obviously not ideal. Hopefully they will fix this soon.
@paulvanbladel Thanks, adding a MaintainCorsHeader middleware to put the headers back was the only thing that worked for me.
Regardless, it doesn't seem to be a problem with GlobalExceptionHandler.
When I set up CORS it correctly adds Access-Control headers to non-erroring API responses. However, they aren't generated on an unhandled error that passes through GlobalExceptionHandlerDotNet.
Is there something else I need to do to set the proper response headers?