validate `file` option

pull/128/merge
Fabian Jakobs 2016-01-15 11:29:41 +00:00
rodzic dcd8e9df98
commit d195ab7317
1 zmienionych plików z 3 dodań i 0 usunięć

Wyświetl plik

@ -84,6 +84,9 @@ module.exports = function(vfs, options) {
if (!options.file) if (!options.file)
return callback(new error.Forbidden("Option 'file' is missing")); return callback(new error.Forbidden("Option 'file' is missing"));
if (typeof options.file != "string")
return callback(new error.Forbidden("Invalid option 'file'"));
if (extendDirectory) { if (extendDirectory) {
var file = options.file = path.normalize(path.join(extendDirectory, options.file)); var file = options.file = path.normalize(path.join(extendDirectory, options.file));