mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 23:22:02 +00:00
fix(nuxt): allow prefetching urls with query string (#25658)
This commit is contained in:
parent
36767e6b52
commit
25f1787922
@ -53,9 +53,6 @@ export function preloadPayload (url: string, opts: LoadPayloadOptions = {}) {
|
|||||||
const extension = renderJsonPayloads ? 'json' : 'js'
|
const extension = renderJsonPayloads ? 'json' : 'js'
|
||||||
function _getPayloadURL (url: string, opts: LoadPayloadOptions = {}) {
|
function _getPayloadURL (url: string, opts: LoadPayloadOptions = {}) {
|
||||||
const u = new URL(url, 'http://localhost')
|
const u = new URL(url, 'http://localhost')
|
||||||
if (u.search) {
|
|
||||||
throw new Error('Payload URL cannot contain search params: ' + url)
|
|
||||||
}
|
|
||||||
if (u.host !== 'localhost' || hasProtocol(u.pathname, { acceptRelative: true })) {
|
if (u.host !== 'localhost' || hasProtocol(u.pathname, { acceptRelative: true })) {
|
||||||
throw new Error('Payload URL must not include hostname: ' + url)
|
throw new Error('Payload URL must not include hostname: ' + url)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user