fix(nuxt): test generated pathname

This commit is contained in:
Daniel Roe 2023-02-16 17:16:51 +00:00
parent e9ff34ace4
commit af55b9882e

View File

@ -41,7 +41,7 @@ function _getPayloadURL (url: string, opts: LoadPayloadOptions = {}) {
if (u.search) {
throw new Error('Payload URL cannot contain search params: ' + url)
}
if (u.host !== 'localhost' || hasProtocol(url, true)) {
if (u.host !== 'localhost' || hasProtocol(u.pathname, true)) {
throw new Error('Payload URL must not include hostname: ' + url)
}
const hash = opts.hash || (opts.fresh ? Date.now() : '')