-
-
Notifications
You must be signed in to change notification settings - Fork 109
Description
Take the following files within the root directory:
index.html
sub/index.html
Configure fastify-static to include index: 'index.html'. In this case http://localhost/ serves the root index.html, http://localhost/sub/ serves sub/index.html. But http://localhost/sub is a 404 error. Would you accept an option that would hook send.on('directory') to perform a 301 redirect of such requests to the path including the trialing slash? Such that http://localhost/sub would be 301 with Location: http://localhost/sub/. I haven't tested this yet but the send documentation tells how to accomplish this. I'm assuming that directory redirects would need to be opt-in rather than opt-out? Either would be fine with me, just figured I'd ask since fastify-static is in the middle of a semver-major release.