mirror of
https://github.com/LBRYFoundation/lbry-desktop.git
synced 2025-08-29 16:31:33 +00:00
decode url on lbrytv server
This commit is contained in:
parent
db5647a7f1
commit
462f1542e7
1 changed files with 6 additions and 0 deletions
|
@ -7,6 +7,12 @@ async function redirectMiddleware(ctx, next) {
|
||||||
const requestHost = ctx.host;
|
const requestHost = ctx.host;
|
||||||
const path = ctx.path;
|
const path = ctx.path;
|
||||||
const url = ctx.url;
|
const url = ctx.url;
|
||||||
|
const decodedUrl = decodeURIComponent(url);
|
||||||
|
|
||||||
|
if (decodedUrl !== url) {
|
||||||
|
ctx.redirect(decodedUrl);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (path.endsWith('/') && path.length > 1) {
|
if (path.endsWith('/') && path.length > 1) {
|
||||||
ctx.redirect(url.replace(/\/$/, ''));
|
ctx.redirect(url.replace(/\/$/, ''));
|
||||||
|
|
Loading…
Add table
Reference in a new issue