mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
💄 Ensure all middleware use named functions (#7434)
no issue - anonymous functions are hard to debug in memory traces etc - having anonymous middleware functions makes it hard to inspect or debug the middleware stack (something I like to do) - these 2 are the only ones atm, including all 3rd party middleware
This commit is contained in:
parent
6d092ada99
commit
b0af496c98
2 changed files with 2 additions and 2 deletions
|
@ -2,7 +2,7 @@ var config = require('../config'),
|
|||
i18n = require('../i18n'),
|
||||
errors = require('../errors');
|
||||
|
||||
module.exports = function (req, res, next) {
|
||||
module.exports = function maintenance(req, res, next) {
|
||||
if (config.get('maintenance').enabled) {
|
||||
return next(new errors.Maintenance(
|
||||
i18n.t('errors.general.maintenance')
|
||||
|
|
|
@ -7,7 +7,7 @@ module.exports = function upload(options) {
|
|||
var type = options.type;
|
||||
|
||||
// if we finish the data/importer logic, we forward the request to the specified importer
|
||||
return function (req, res, next) {
|
||||
return function uploadValidation(req, res, next) {
|
||||
var extensions = (config.get('uploads')[type] && config.get('uploads')[type].extensions) || [],
|
||||
contentTypes = (config.get('uploads')[type] && config.get('uploads')[type].contentTypes) || [];
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue