adamchainz / django-cors-headers

Django app for handling the server headers required for Cross-Origin Resource Sharing (CORS)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No Cors headers sent for 500 errors

gone opened this issue · comments

This is a minor QOL dev compliant - When doing something stupid in the server, rather than getting a 500 response from the server I get a CORS issue in my client.

Unfortunately it's not possible to add headers in a middleware to 500 error responses. These are generated by the handler500 view configured in Django, which runs outside the middleware stack :/

I'll keep this in mind for any potential refactoring but closing since it's not possible. Agree it would make development a bit easier.