From 5c339656b7a08f8159391c8be5ae1fa59d11a1fa Mon Sep 17 00:00:00 2001 From: calzoneman Date: Mon, 2 Nov 2015 20:52:57 -0800 Subject: [PATCH] Minor fixes --- src/web/auth.js | 2 +- src/web/routes/channel.js | 2 +- templates/httperror.jade | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) 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}