Prerequisites
Fastify version
latest
Plugin version
latest
Node.js version
latest
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
N/A
Description
@fastify/static calls fastify.errorHandler() (source).
However, it throws away the return value, which breaks cases where the error handler returns a value, rather than calling reply.send.
Vanilla Fastify allows, and properly handles, returning the reply from the error handler.
Link to code that reproduces the bug
https://github.com/abrahamguo/repro/tree/fastify-static
Expected Behavior
@fastify/static should return the return value of fastify.errorHandler().
Prerequisites
Fastify version
latest
Plugin version
latest
Node.js version
latest
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
N/A
Description
@fastify/staticcallsfastify.errorHandler()(source).However, it throws away the return value, which breaks cases where the error handler returns a value, rather than calling
reply.send.Vanilla Fastify allows, and properly handles, returning the reply from the error handler.
Link to code that reproduces the bug
https://github.com/abrahamguo/repro/tree/fastify-static
Expected Behavior
@fastify/staticshould return the return value offastify.errorHandler().