diff --git a/src/web/auth.js b/src/web/auth.js index 8fca7352..5e639db8 100644 --- a/src/web/auth.js +++ b/src/web/auth.js @@ -127,7 +127,7 @@ function handleLogout(req, res) { res.clearCookie("auth"); req.user = res.user = null; // Try to find an appropriate redirect - var dest = req.params.dest || req.header("referer"); + var dest = req.body.dest || req.header("referer"); dest = dest && dest.match(/login|logout|account/) ? null : dest; var host = req.hostname; diff --git a/src/web/routes/channel.js b/src/web/routes/channel.js index 8fcf1dea..457565d9 100644 --- a/src/web/routes/channel.js +++ b/src/web/routes/channel.js @@ -8,7 +8,7 @@ export default function initialize(app, ioConfig) { app.get('/r/:channel', (req, res) => { if (!req.params.channel || !CyTubeUtil.isValidChannelName(req.params.channel)) { throw new HTTPError(`"${sanitizeText(req.params.channel)}" is not a valid ` + - 'channel name.', { status: HTTPStatus.BAD_REQUEST }); + 'channel name.', { status: HTTPStatus.NOT_FOUND }); } const endpoints = ioConfig.getSocketEndpoints(); diff --git a/templates/httperror.jade b/templates/httperror.jade index 5ac23c71..56909bc9 100644 --- a/templates/httperror.jade +++ b/templates/httperror.jade @@ -1,6 +1,8 @@ mixin notfound() h1 Not Found p The page you were looking for doesn't seem to exist. Please check that you typed the URL correctly. + if message + p Reason: #{message} mixin forbidden() h1 Forbidden p You don't have permission to access #{path}