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:
committed by
Diamond Lewis
parent
93fe6b44e4
commit
1c8d4a6519
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user