mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-19 23:10:21 +01:00
lint: fix lint
This commit is contained in:
@@ -2,14 +2,15 @@
|
|||||||
|
|
||||||
const multer = require('multer');
|
const multer = require('multer');
|
||||||
const storage = multer.diskStorage({});
|
const storage = multer.diskStorage({});
|
||||||
const upload = multer({ storage,
|
const upload = multer({
|
||||||
|
storage,
|
||||||
// from https://github.com/TriliumNext/Trilium/pull/3058/files
|
// from https://github.com/TriliumNext/Trilium/pull/3058/files
|
||||||
fileFilter: (req, file, cb) => {
|
fileFilter: (req, file, cb) => {
|
||||||
// UTF-8 file names are not well decoded by multer/busboy, so we handle the conversion on our side.
|
// UTF-8 file names are not well decoded by multer/busboy, so we handle the conversion on our side.
|
||||||
// See https://github.com/expressjs/multer/pull/1102.
|
// See https://github.com/expressjs/multer/pull/1102.
|
||||||
file.originalname = Buffer.from(file.originalname, 'latin1').toString('utf-8');
|
file.originalname = Buffer.from(file.originalname, 'latin1').toString('utf-8');
|
||||||
cb(null, true);
|
cb(null, true);
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports = upload;
|
module.exports = upload;
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ Auth.reloadRoutes = async function (params) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
const upload = require('../middleware/multer')
|
const upload = require('../middleware/multer');
|
||||||
const middlewares = [
|
const middlewares = [
|
||||||
upload.any(),
|
upload.any(),
|
||||||
Auth.middleware.applyCSRF,
|
Auth.middleware.applyCSRF,
|
||||||
|
|||||||
Reference in New Issue
Block a user