mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-18 17:35:57 +00:00
fix(nuxt): remove trailing slash before checking if prerendered (#24516)
This commit is contained in:
parent
1b1cc4f4e9
commit
5b4d638720
@ -1,4 +1,4 @@
|
||||
import { hasProtocol, joinURL } from 'ufo'
|
||||
import { hasProtocol, joinURL, withoutTrailingSlash } from 'ufo'
|
||||
import { parse } from 'devalue'
|
||||
import { useHead } from '@unhead/vue'
|
||||
import { getCurrentInstance } from 'vue'
|
||||
@ -79,6 +79,7 @@ async function _importPayload (payloadURL: string) {
|
||||
export async function isPrerendered (url = useRoute().path) {
|
||||
// Note: Alternative for server is checking x-nitro-prerender header
|
||||
if (!appManifest) { return !!useNuxtApp().payload.prerenderedAt }
|
||||
url = withoutTrailingSlash(url)
|
||||
const manifest = await getAppManifest()
|
||||
if (manifest.prerendered.includes(url)) {
|
||||
return true
|
||||
|
Loading…
Reference in New Issue
Block a user