TrustedHostMiddleware returns response instead of throwing an exception #2747
Unanswered
ccrims0n
asked this question in
Potential Issue
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
TrustedHostMiddleware generates the response to the client instead of raising an exception.
This takes away the control from the developer of handling the exception and responding to the client in the format it understands or the developer sees as feasible.
In our case, we always want to respond with JSON and in a specific format because of this, we are unable to modify this. The only way for us is to override the middleware and write custom code.
We also want to obscure the exact reason for the error.
Beta Was this translation helpful? Give feedback.
All reactions