mirror of
https://github.com/IT4Change/boilerplate-frontend.git
synced 2025-12-13 07:35:53 +00:00
disable early hints when there is no environment value set for it
This commit is contained in:
parent
9cf9ff7258
commit
29e7be74f5
@ -80,7 +80,7 @@ async function startServer() {
|
|||||||
next()
|
next()
|
||||||
} else {
|
} else {
|
||||||
const { body, statusCode, headers, earlyHints } = httpResponse
|
const { body, statusCode, headers, earlyHints } = httpResponse
|
||||||
if (res.writeEarlyHints)
|
if (process.env.EARLY_HINTS && res.writeEarlyHints)
|
||||||
res.writeEarlyHints({ link: earlyHints.map((e) => e.earlyHintLink) })
|
res.writeEarlyHints({ link: earlyHints.map((e) => e.earlyHintLink) })
|
||||||
headers.forEach(([name, value]) => res.setHeader(name, value))
|
headers.forEach(([name, value]) => res.setHeader(name, value))
|
||||||
res.status(statusCode)
|
res.status(statusCode)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user