-
-
Notifications
You must be signed in to change notification settings - Fork 77
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite body #265
Comments
For anyone else having this problem. I created this function and it solved it:
You will also need:
And call it using:
|
@mcollina would be great if this could be added to fastify like a hook or something. something like rewriteBody so please who need to change the body can easily do it |
Reopened as a feature request I think we could provide a feature for it, but as your example shows, there are stuff like compression and content type to deal with. I think a good tread off between simplicity and usability could be:
I'm assuming users do not want deal with stream here |
I use @fastify/http-proxy and it works wonderfully (and faster then http-proxy-middleware). The only thing I can't figure out how can I rewrite the body of a response? I need to change the html before is send back to the client.
The text was updated successfully, but these errors were encountered: