Skip to content

Commit 18db923

Browse files
committed
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.
1 parent 6f5864d commit 18db923

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

scripts/validate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ if has_test "compression"; then
311311

312312
# Must return Content-Encoding: gzip when Accept-Encoding: gzip is sent
313313
comp_headers=$(curl -s -D- -o /dev/null -H "Accept-Encoding: gzip" "http://localhost:$PORT/compression")
314-
comp_encoding=$(echo "$comp_headers" | grep -i "^content-encoding:" | tr -d '\r' | awk '{print tolower($2)}' || true)
314+
comp_encoding=$(echo "$comp_headers" | grep -i "^content-encoding:" | sed 's/^[^:]*: *//' | tr -d '\r' | awk '{print tolower($2)}' || true)
315315
if [ "$comp_encoding" = "gzip" ]; then
316316
echo " PASS [compression Content-Encoding: gzip]"
317317
PASS=$((PASS + 1))

0 commit comments

Comments
 (0)