Closed da-ekchajzer closed 11 months ago
Given the corresponding PR has been merged, we could probably close this.
BTW, I had another proposition to work around this issue, based on a exception_handler (adding explicitly the CORS header when we get an app level exception) , but I don't know enough of starlette to know if it's better or worse than the solution from @cosmastech .
I am not familiar with it either. I am closing the issue. We could open an issue on the error managing system which might use exception_handler.
Problem
When the API raises an error (wich is not catch), FastAPI doesn't put the CORS header. This result on users having a CORS error even if the issue is related with the API process.
https://github.com/tiangolo/fastapi/issues/775#issuecomment-585413335
Solution
We should provide a clearer message to users when the API raises an error.
Some workaround can be found here (https://github.com/tiangolo/fastapi/issues/775)
This issue could be the beginning of an error managing system