mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 22:25:12 +00:00
fix: redirect works with full path
This commit is contained in:
parent
5682eef2a5
commit
703b5071d6
@ -36,7 +36,9 @@ export default async (context) => {
|
||||
}
|
||||
opts.query = stringify(opts.query)
|
||||
opts.path = opts.path + (opts.query ? '?' + opts.query : '')
|
||||
if (opts.path.indexOf('http') !== 0 && ('<%= router.base %>' !== '/' && opts.path.indexOf('<%= router.base %>') !== 0)) {
|
||||
opts.path = urlJoin('<%= router.base %>', opts.path)
|
||||
}
|
||||
context.res.writeHead(opts.status, {
|
||||
'Location': opts.path
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user