Skip to content

Commit eb4e22b

Browse files
committed
fix: update to refresh on 1 + ignore meta-refresh rule
1 parent bdd7ec9 commit eb4e22b

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

nuxt.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,9 @@ export default defineNuxtConfig({
227227

228228
htmlValidator: {
229229
enabled: !isCI || (provider !== 'vercel' && !!process.env.VALIDATE_HTML),
230+
options: {
231+
rules: { 'meta-refresh': 'off' },
232+
},
230233
failOnError: true,
231234
},
232235

server/plugins/fallback-ui.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
export default defineNitroPlugin(nitroApp => {
2-
nitroApp.hooks.hook('render:html', (html, { event }) => {
3-
if (event.path.includes('/200.html')) {
4-
html.head.push('<noscript><meta http-equiv="refresh" content="0"></noscript>')
5-
}
6-
})
2+
if (import.meta.prerender) {
3+
nitroApp.hooks.hook('render:html', (html, { event }) => {
4+
if (event.path === '/200.html') {
5+
html.head.push('<noscript><meta http-equiv="refresh" content="1"></noscript>')
6+
}
7+
})
8+
}
79
})

0 commit comments

Comments
 (0)