Open imcm7 opened 1 year ago
May be if (!response.headers?.['content-type'] || !response.headers?.['content-type'].startsWith('text/html')) {}
You can add an extra nullish coalescing check after array lookups:
if (!response.headers?.['content-type']?.startsWith('text/html')) {
Environment
Reproduction
Describe the bug
Cannot read properties of undefined (reading 'startsWith') at (./server/plugins/compression.ts:9:1) (./node_modules/nitropack/dist/runtime/renderer.mjs:29:5)
at ./node_modules/hookable/dist/index.mjs:48:66
at ./node_modules/hookable/dist/index.mjs:48:56
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at
at async Object.handler (./node_modules/h3/dist/index.mjs:1630:19)
at async Server.toNodeHandle (./node_modules/h3/dist/index.mjs:1840:7)
Additional context
No response
Logs
No response