diff --git a/src/node/hooks/express/padurlsanitize.js b/src/node/hooks/express/padurlsanitize.js
index 8a287a961..c4c1b6751 100644
--- a/src/node/hooks/express/padurlsanitize.js
+++ b/src/node/hooks/express/padurlsanitize.js
@@ -1,7 +1,9 @@
+'use strict';
+
const padManager = require('../../db/PadManager');
const url = require('url');
-exports.expressCreateServer = function (hook_name, args, cb) {
+exports.expressCreateServer = (hookName, args, cb) => {
// redirects browser to the pad's sanitized url if needed. otherwise, renders the html
args.app.param('pad', async (req, res, next, padId) => {
// ensure the padname is valid and the url doesn't end with a /
@@ -17,12 +19,12 @@ exports.expressCreateServer = function (hook_name, args, cb) {
next();
} else {
// the pad id was sanitized, so we redirect to the sanitized version
- let real_url = sanitizedPadId;
- real_url = encodeURIComponent(real_url);
+ let realURL = sanitizedPadId;
+ realURL = encodeURIComponent(realURL);
const query = url.parse(req.url).query;
- if (query) real_url += `?${query}`;
- res.header('Location', real_url);
- res.status(302).send(`You should be redirected to ${real_url}`);
+ if (query) realURL += `?${query}`;
+ res.header('Location', realURL);
+ res.status(302).send(`You should be redirected to ${realURL}`);
}
});
return cb();