padurlsanitize: early return, no functional changes

This commit is contained in:
muxator 2018-08-29 01:38:55 +02:00
parent d19436d044
commit 391bd79e03

View file

@ -8,9 +8,9 @@ exports.expressCreateServer = function (hook_name, args, cb) {
if(!padManager.isValidPadId(padId) || /\/$/.test(req.url)) if(!padManager.isValidPadId(padId) || /\/$/.test(req.url))
{ {
res.status(404).send('Such a padname is forbidden'); res.status(404).send('Such a padname is forbidden');
return;
} }
else
{
padManager.sanitizePadId(padId, function(sanitizedPadId) { padManager.sanitizePadId(padId, function(sanitizedPadId) {
//the pad id was sanitized, so we redirect to the sanitized version //the pad id was sanitized, so we redirect to the sanitized version
if(sanitizedPadId != padId) if(sanitizedPadId != padId)
@ -28,6 +28,5 @@ exports.expressCreateServer = function (hook_name, args, cb) {
next(); next();
} }
}); });
}
}); });
} }