From 4f5f563776703ab9ce38941227d87a655775af07 Mon Sep 17 00:00:00 2001 From: pieh Date: Mon, 14 Oct 2024 13:29:34 +0200 Subject: [PATCH] fix: drop empty directives to not produce invalid header values --- src/run/headers.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/run/headers.ts b/src/run/headers.ts index 411edf0052..9af7f26832 100644 --- a/src/run/headers.ts +++ b/src/run/headers.ts @@ -54,7 +54,10 @@ const generateNetlifyVaryValues = ({ } const getHeaderValueArray = (header: string): string[] => { - return header.split(',').map((value) => value.trim()) + return header + .split(',') + .map((value) => value.trim()) + .filter(Boolean) } const omitHeaderValues = (header: string, values: string[]): string => {