Merge pull request #110 from IT4Change/disable-103-earlyhints

fix(frontend): disable 103 early hints
This commit is contained in:
Ulf Gebhardt 2024-03-14 12:31:41 +01:00 committed by GitHub
commit 40face508c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -80,7 +80,7 @@ async function startServer() {
next()
} else {
const { body, statusCode, headers, earlyHints } = httpResponse
if (res.writeEarlyHints)
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)