Skip to content

Commit 2270c5a

Browse files
ligazgatsbybot
and
gatsbybot
authored
feat(gatsby): allow serving of dotfiles from public folder (#24958)
* Allow serving of dotfiles from public folder Currently if we generate a page which name starts with a dot `.` it will not be served correctly by `gatsby serve`. The actual behavior is even stranger because the server returns the `404` page, but then the client side rendering picks it up and actually re-renders the page. This change fixes this behavior by allowing the serving of `dotfiles` from the static `public` directory. * chore: format Co-authored-by: gatsbybot <[email protected]>
1 parent 8d5664f commit 2270c5a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/gatsby/src/commands/serve.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ module.exports = async (program: IServeProgram): Promise<void> => {
106106
app.use(telemetry.expressMiddleware(`SERVE`))
107107

108108
router.use(compression())
109-
router.use(express.static(`public`))
109+
router.use(express.static(`public`, { dotfiles: `allow` }))
110110
const matchPaths = await readMatchPaths(program)
111111
router.use(matchPathRouter(matchPaths, { root }))
112112
router.use((req, res, next) => {

0 commit comments

Comments
 (0)