Move filename validation out of the Router and into the FilesAdaptor (#6157)

* Move filename validation out of the Router and into the FilesAdaptor

* Address PR comments

* Update unittests to handle FilesAdapter interface change

* Make validateFilename optional
This commit is contained in:
Mike Patnode
2019-10-26 19:15:21 -07:00
committed by Diamond Lewis
parent 93fe6b44e4
commit 1c8d4a6519
7 changed files with 93 additions and 22 deletions

View File

@@ -8,7 +8,7 @@
// @flow-disable-next
import { MongoClient, GridFSBucket, Db } from 'mongodb';
import { FilesAdapter } from './FilesAdapter';
import { FilesAdapter, validateFilename } from './FilesAdapter';
import defaults from '../../defaults';
export class GridFSBucketAdapter extends FilesAdapter {
@@ -139,6 +139,10 @@ export class GridFSBucketAdapter extends FilesAdapter {
}
return this._client.close(false);
}
validateFilename(filename) {
return validateFilename(filename);
}
}
export default GridFSBucketAdapter;