-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[onError][reply] hide sensitive data in the error response #611
Comments
https://www.fastify.io/docs/latest/Reference/Hooks/#onerror
Define your own |
@climba03003 as you can see below, the onError hook runs at the end and requires an error instance, so it cannot be changed in the custom error handler. |
On another thought, there is no special requirement to hold on to this hook. Just the meaning of this I think it would be more logical to call this hook before calling |
This was significantly refactored in fastify/fastify#3261. Can you check out the Not that for redacting sensitive info in the logs you should use https://getpino.io/#/docs/redaction |
Hi guys, sorry if this is trivial, couldn't figure out how to do it.
馃挰 Question here
onError
hook, where there is no way to change the body of the reply, but only the status. Am I missing something?Yes, I can mutate the error itself, but that will affect the logs as well.
Perhaps there is an easier solution to hide the error message in the response.
Thank you.
The text was updated successfully, but these errors were encountered: