Fix the redirect.

This commit is contained in:
Ivaylo Novakov 2020-08-05 17:55:49 +03:00
parent 87a3cb8aa7
commit 71d2b3dc91
No known key found for this signature in database
GPG Key ID: 06B9354AB08BE9C6
1 changed files with 2 additions and 2 deletions

View File

@ -75,8 +75,8 @@ server.use(
proxy("nginx", {
// eslint-disable-next-line no-unused-vars
userResHeaderDecorator(headers, userReq, userRes, proxyReq, proxyRes) {
if (!userReq.path.endsWith("/")) {
userRes.redirect(307, `${userReq.path}/`);
if (!userReq.url.endsWith("/")) {
userRes.redirect(307, `${userReq.url}/`);
}
if (headers.location && headers.location.match(startsWithSkylinkRegExp)) {
headers.location = headers.location.replace(