Skip to content
Snippets Groups Projects
Commit 1614b338 authored by Xiao Gui's avatar Xiao Gui
Browse files

fix saneUrl extra path

parent 470a26f1
No related branches found
No related tags found
No related merge requests found
......@@ -56,7 +56,13 @@ router.get('/:name', async (req, res) => {
if (redirectFlag) {
if (queryString) return res.redirect(`${REAL_HOSTNAME}?${queryString}`)
if (hashPath) return res.redirect(`${REAL_HOSTNAME}#${hashPath}/${xtraRoutes.join('/')}`)
if (hashPath) {
let redirectUrl = `${REAL_HOSTNAME}#${hashPath}`
if (xtraRoutes.length > 0) {
redirectUrl += `/${xtraRoutes.join('/')}`
}
return res.redirect(redirectUrl)
}
} else {
return res.status(200).send(json)
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment