right now if a client send hello and the user set an instance hook:
app.addHook('preParsing', function (req, reply, payload, done) {... that changes hello to goodbye, the request.rawBody will be equals to goodbye.
I think that there is not an easy way to get hello since the application hook is not listed in the onRoute hook.
I can manage the order of route's hook only.
Is this "not a problem"? Since the preParsing could be used to run decompression.
Edit: found how to get the body before any preParsing change it: add runFirst option
Doubt:
right now if a client send
hello
and the user set an instance hook:app.addHook('preParsing', function (req, reply, payload, done) {...
that changeshello
togoodbye
, therequest.rawBody
will be equals togoodbye
.I think that there is not an easy way to get
hello
since the application hook is not listed in theonRoute
hook. I can manage the order of route's hook only.Is this "not a problem"? Since the
preParsing
could be used to run decompression.Edit: found how to get the body before any
preParsing
change it: addrunFirst
optionTODO
getRawBodyError
Closes https://github.com/fastify/fastify/issues/707