comment out redirect stuff
This commit is contained in:
parent
5584096da2
commit
626334241c
1 changed files with 7 additions and 5 deletions
|
@ -7,12 +7,14 @@ async function redirectMiddleware(ctx, next) {
|
|||
const requestHost = ctx.host;
|
||||
const path = ctx.path;
|
||||
const url = ctx.url;
|
||||
const decodedUrl = decodeURIComponent(url);
|
||||
// Getting err: too many redirects on some urls because of this
|
||||
// Need a better solution
|
||||
// const decodedUrl = decodeURIComponent(url);
|
||||
|
||||
if (decodedUrl !== url) {
|
||||
ctx.redirect(decodedUrl);
|
||||
return;
|
||||
}
|
||||
// if (decodedUrl !== url) {
|
||||
// ctx.redirect(decodedUrl);
|
||||
// return;
|
||||
// }
|
||||
|
||||
if (path.endsWith('/') && path.length > 1) {
|
||||
ctx.redirect(url.replace(/\/$/, ''));
|
||||
|
|
Loading…
Add table
Reference in a new issue