@fastify/static 6.11.1 → 6.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +4 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -396,7 +396,9 @@ async function fastifyStatic (fastify, opts) {
396
396
  }
397
397
 
398
398
  function serveFileHandler (req, reply) {
399
- const routeConfig = req.routeOptions.config
399
+ // TODO: remove the fallback branch when bump major
400
+ /* istanbul ignore next */
401
+ const routeConfig = req.routeOptions?.config || req.routeConfig
400
402
  pumpSendToReply(req, reply, routeConfig.file, routeConfig.rootPath)
401
403
  }
402
404
  }
@@ -552,7 +554,7 @@ function getRedirectUrl (url) {
552
554
  }
553
555
 
554
556
  module.exports = fp(fastifyStatic, {
555
- fastify: '^4.23.0',
557
+ fastify: '4.x',
556
558
  name: '@fastify/static'
557
559
  })
558
560
  module.exports.default = fastifyStatic
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fastify/static",
3
- "version": "6.11.1",
3
+ "version": "6.11.2",
4
4
  "description": "Plugin for serving static files as fast as possible.",
5
5
  "main": "index.js",
6
6
  "types": "types/index.d.ts",