G
G
Grigory Vasilkov2017-09-30 13:57:29
Node.js
Grigory Vasilkov, 2017-09-30 13:57:29

How to prevent express.static() from serving files from directories starting with a dot?

The express.static() module returns files on request.
If the first character in the file name is a dot (hidden file), an error is returned, as it should be. There is an option to turn it back on.
I do not understand how to make the same ban on directories. If I create a directory with a dot, and put a file without a dot in it, I can safely download it.
How to do?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question