fastify-static
fastify-static copied to clipboard
`dotfiles` option doesn't work with `wildcard: false`
Prerequisites
- [X] I have written a descriptive issue title
- [X] I have searched existing issues to ensure the bug has not already been reported
Fastify version
3.27.3
Plugin version
4.5.0
Node.js version
v16.13.1
Operating system
Windows
Operating system version (i.e. 20.04, 11.3, 10)
11
Description
When specifying the dotfiles: 'allow' option together with wildcard: false, the dot files are not returned. Looking into the implementation, this seems to be because glob doesn't have the dot: true option specified, therefore it will not match dotfiles/directories.
Steps to Reproduce
-
Add a dotfile to the served static files (e.g.,
.well-known/assetlinks.json) -
Register
fastify-staticwith the following options:server.register(fastifyStatic, { root: '/build/public', wildcard: false, dotfiles: 'allow', }); -
Run
curl -L http://localhost:3000/.well-known/assetlinks.json
Expected Behavior
Expected to return the file inside the .well-known directory.