mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-14 10:04:05 +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.query = stringify(opts.query)
|
||||||
opts.path = opts.path + (opts.query ? '?' + 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)
|
opts.path = urlJoin('<%= router.base %>', opts.path)
|
||||||
|
}
|
||||||
context.res.writeHead(opts.status, {
|
context.res.writeHead(opts.status, {
|
||||||
'Location': opts.path
|
'Location': opts.path
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user