mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-07 13:46:34 +02:00
feat: more naming
This commit is contained in:
@@ -7,7 +7,7 @@ var validator = require('validator');
|
||||
var meta = require('../meta');
|
||||
var plugins = require('../plugins');
|
||||
|
||||
exports.handle404 = function (req, res) {
|
||||
exports.handle404 = function handle404(req, res) {
|
||||
var relativePath = nconf.get('relative_path');
|
||||
var isClientScript = new RegExp('^' + relativePath + '\\/assets\\/src\\/.+\\.js');
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ var winston = require('winston');
|
||||
var validator = require('validator');
|
||||
var plugins = require('../plugins');
|
||||
|
||||
exports.handleURIErrors = function (err, req, res, next) {
|
||||
exports.handleURIErrors = function handleURIErrors(err, req, res, next) {
|
||||
// Handle cases where malformed URIs are passed in
|
||||
if (err instanceof URIError) {
|
||||
const cleanPath = req.path.replace(new RegExp('^' + nconf.get('relative_path')), '');
|
||||
@@ -36,7 +36,7 @@ exports.handleURIErrors = function (err, req, res, next) {
|
||||
|
||||
// this needs to have four arguments or express treats it as `(req, res, next)`
|
||||
// don't remove `next`!
|
||||
exports.handleErrors = function (err, req, res, next) { // eslint-disable-line no-unused-vars
|
||||
exports.handleErrors = function handleErrors(err, req, res, next) { // eslint-disable-line no-unused-vars
|
||||
var cases = {
|
||||
EBADCSRFTOKEN: function () {
|
||||
winston.error(req.path + '\n', err.message);
|
||||
|
||||
Reference in New Issue
Block a user