diff --git a/src/storage/filesystem.js b/src/storage/filesystem.js index 960b54a2b..d5b044721 100644 --- a/src/storage/filesystem.js +++ b/src/storage/filesystem.js @@ -260,8 +260,10 @@ function testConfig(apiConfig, callback) { if (error) return callback(error); if (typeof apiConfig.prefix !== 'string') return callback(new BoxError(BoxError.BAD_FIELD, 'prefix must be a string', { field: 'prefix' })); - if (path.isAbsolute(apiConfig.prefix)) return new BoxError(BoxError.BAD_FIELD, 'prefix must be a relative path', { field: 'backupFolder' }); - if (path.normalize(apiConfig.prefix) !== apiConfig.prefix) return callback(new BoxError(BoxError.BAD_FIELD, 'prefix must contain a normalized relative path', { field: 'prefix' })); + if (apiConfig.prefix !== '') { + if (path.isAbsolute(apiConfig.prefix)) return new BoxError(BoxError.BAD_FIELD, 'prefix must be a relative path', { field: 'backupFolder' }); + if (path.normalize(apiConfig.prefix) !== apiConfig.prefix) return callback(new BoxError(BoxError.BAD_FIELD, 'prefix must contain a normalized relative path', { field: 'prefix' })); + } const mounts = safe.fs.readFileSync('/proc/mounts', 'utf8'); const mountInfo = mounts.split('\n').filter(function (l) { return l.indexOf(apiConfig.mountPoint) !== -1; })[0];