From bfc581cbda05bf6506aa6e92f4de5a7a09862df2 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Wed, 8 Jan 2020 19:26:36 -0500 Subject: [PATCH] move hompage redirect to end --- lbrytv/middleware/redirect.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lbrytv/middleware/redirect.js b/lbrytv/middleware/redirect.js index 80877e415..8a5514dd1 100644 --- a/lbrytv/middleware/redirect.js +++ b/lbrytv/middleware/redirect.js @@ -19,11 +19,6 @@ async function redirectMiddleware(ctx, next) { return; } - if (path === '/') { - ctx.redirect(`/$/${PAGES.CHANNELS_FOLLOWING}`); - return; - } - if (!path.startsWith('/$/') && path.match(/^([^@/:]+)\/([^:/]+)$/)) { ctx.redirect(url.replace(/^([^@/:]+)\/([^:/]+)(:(\/.*))/, '$1:$2')); // test against path, but use ctx.url to retain parameters return; @@ -43,6 +38,11 @@ async function redirectMiddleware(ctx, next) { return; } + if (path === '/') { + ctx.redirect(`/$/${PAGES.CHANNELS_FOLLOWING}`); + return; + } + // No redirects needed await next(); }