Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shuding committed Oct 24, 2022
1 parent 160f4b7 commit 6067bd6
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions packages/next/server/app-render.tsx
Expand Up @@ -1525,26 +1525,6 @@ export async function renderToHTMLOrFlight(
...validateRootLayout,
})

if (generateStaticHTML) {
let html = await streamToString(result)

if (
allCapturedErrors.some(
(e: any) => e.digest === NOT_FOUND_ERROR_CODE
)
) {
// If a not found error is thrown, we return 404 and make sure to
// inject the noindex tag.
res.statusCode = 404
html = html.replace(
'<head>',
'<head><meta name="robots" content="noindex"/>'
)
}

return html
}

return result
} catch (err: any) {
const shouldNotIndex = err.digest === NOT_FOUND_ERROR_CODE
Expand Down

0 comments on commit 6067bd6

Please sign in to comment.