From f19228c58e6f0a752777b7259341704069e273f9 Mon Sep 17 00:00:00 2001 From: Petrik Date: Sun, 29 Mar 2026 17:13:31 +0200 Subject: [PATCH] Allow Content-Encoding header to have no whitespace Some framework return headers without whitespace: content-encoding:gzip The `check_header` method already takes this into account, but the encoding header check does not. --- scripts/validate.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/validate.sh b/scripts/validate.sh index 02d62e37..743af972 100755 --- a/scripts/validate.sh +++ b/scripts/validate.sh @@ -318,7 +318,7 @@ if has_test "compression"; then # Must return Content-Encoding: gzip when Accept-Encoding: gzip is sent comp_headers=$(curl -s -D- -o /dev/null -H "Accept-Encoding: gzip" "http://localhost:$PORT/compression") - comp_encoding=$(echo "$comp_headers" | grep -i "^content-encoding:" | tr -d '\r' | awk '{print tolower($2)}' || true) + comp_encoding=$(echo "$comp_headers" | grep -i "^content-encoding:" | sed 's/^[^:]*: *//' | tr -d '\r' | awk '{print tolower($1)}' || true) if [ "$comp_encoding" = "gzip" ]; then echo " PASS [compression Content-Encoding: gzip]" PASS=$((PASS + 1))