expressjs/serve-index

Filter option should allow to check full/absolute path

LeoIannacone opened this issue · 1 comments

Hi,

filter function is passed as option and check files list with relative name ..

It would be more useful if files list contained absolute path in order to have full control on filter function.

At least relative path to the given path passed to middleware, for instance:

serve_index('share/', {
    filter: function (filename) {
        // do not show files in private directories:
        return filename.indexOf('/private/') < 0;
    })

file name in this case could be something like share/subdir1/private/access instead of simple access

Yes, I agree. Not having the path is kind of dumb.