Breaking Changes
setHeadersnow usingFastifyReplyinstead ofResponse.
You should refactor your code to use the reply helpers.
For example,
// Before
const fastify = require('fastify')({logger: true})
const path = require('node:path')
fastify.register(require('@fastify/static'), {
root: path.join(__dirname, 'public'),
prefix: '/public/', // optional: default '/',
setHeaders(res) {
res.setHeader('X-Test', 'Foo')
}
})
// After
const fastify = require('fastify')({logger: true})
const path = require('node:path')
fastify.register(require('@fastify/static'), {
root: path.join(__dirname, 'public'),
prefix: '/public/', // optional: default '/',
setHeaders(reply) {
reply.header('X-Test', 'Foo')
}
})What's Changed
- chore!: bump content-disposition fom 1.0.1 to 2.0.1 by @climba03003 in #597
- fix: ignore unsupported deflate for precompressed assets by @jibin7jose in #596
- fix!: allow setHeaders to override send headers by @climba03003 in #598
New Contributors
- @jibin7jose made their first contribution in #596
Full Changelog: v9.3.0...v10.0.0