Passing url query to redirects

This commit is contained in:
mrfry 2020-11-07 14:35:37 +01:00
parent f5626835f3
commit d4d727c3ba
2 changed files with 12 additions and 6 deletions

View file

@ -119,15 +119,15 @@ function GetApp() {
from: '/menuClick', from: '/menuClick',
to: '/', to: '/',
}, },
{
from: '/lred',
to: '/allQuestions.html',
},
{ {
// to be backwards compatible // to be backwards compatible
from: '/legacy', from: '/legacy',
to: '/allQuestions.html', to: '/allQuestions.html',
}, },
{
from: '/lred',
to: '/allQuestions',
},
{ {
from: '/allqr', from: '/allqr',
to: 'http://api.frylabs.net/allqr.txt', to: 'http://api.frylabs.net/allqr.txt',
@ -153,7 +153,13 @@ function GetApp() {
logger.LogReq(req) logger.LogReq(req)
} }
logger.DebugLog(`Qmining module ${redirect.from} redirect`, 'infos', 1) logger.DebugLog(`Qmining module ${redirect.from} redirect`, 'infos', 1)
res.redirect(`${redirect.to}`)
res.redirect(
url.format({
pathname: `${redirect.to}`,
query: req.query,
})
)
}) })
}) })

@ -1 +1 @@
Subproject commit 36a564498b5e7fd513c76ca0547929bfe263bc9f Subproject commit 96a44e3171943f97c8308327670357c4cf2d69b2