Skip to content

Commit

Permalink
make early hints activatable via evironment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
ulfgebhardt committed Mar 11, 2024
1 parent 0872ba2 commit b0f8924
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions presenter/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ async function startServer() {
next()
} else {
const { body, statusCode, headers, earlyHints } = httpResponse
// if (res.writeEarlyHints)
// res.writeEarlyHints({ link: earlyHints.map((e) => e.earlyHintLink) })
if (process.env.EARLY_HINTS && res.writeEarlyHints)
res.writeEarlyHints({ link: earlyHints.map((e) => e.earlyHintLink) })
headers.forEach(([name, value]) => res.setHeader(name, value))
res.status(statusCode)
// For HTTP streams use httpResponse.pipe() instead, see https://vike.dev/stream
Expand Down

0 comments on commit b0f8924

Please sign in to comment.