mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
feat: remove file.isFileTypeAllowed
This commit is contained in:
@@ -53,11 +53,6 @@ file.base64ToLocal = async function (imageData, uploadPath) {
|
||||
return uploadPath;
|
||||
};
|
||||
|
||||
file.isFileTypeAllowed = async function (path) {
|
||||
winston.warn('[deprecated] file.isFileTypeAllowed is deprecated, use image.isFileTypeAllowed');
|
||||
await require('./image').isFileTypeAllowed(path);
|
||||
};
|
||||
|
||||
// https://stackoverflow.com/a/31205878/583363
|
||||
file.appendToFileName = function (filename, string) {
|
||||
const dotIndex = filename.lastIndexOf('.');
|
||||
|
||||
@@ -162,7 +162,7 @@ describe('Upload Controllers', function () {
|
||||
});
|
||||
|
||||
it('should fail if file is not an image', function (done) {
|
||||
file.isFileTypeAllowed(path.join(__dirname, '../test/files/notanimage.png'), function (err) {
|
||||
image.isFileTypeAllowed(path.join(__dirname, '../test/files/notanimage.png'), function (err) {
|
||||
assert.equal(err.message, 'Input file contains unsupported image format');
|
||||
done();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user