From bd2ca06f8fa63cd49a2c9b044cf5afae24d68703 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Tue, 23 Aug 2022 15:00:05 +0200 Subject: [PATCH] Update to support `Content-Length` response header on `HEAD` requests --- composer.json | 2 +- tests/acceptance.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 98027b3..77f6f4b 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "php": ">=7.1", "nikic/fast-route": "^1.3", "react/async": "^4 || ^3", - "react/http": "^1.6", + "react/http": "^1.7", "react/promise": "^2.7" }, "require-dev": { diff --git a/tests/acceptance.sh b/tests/acceptance.sh index 2eecdb9..fd5b59c 100755 --- a/tests/acceptance.sh +++ b/tests/acceptance.sh @@ -105,7 +105,7 @@ out=$(curl -v $base -X OPTIONS --request-target "*" 2>&1); skipif "Server: ngin out=$(curl -v $base/method/get 2>&1); match "HTTP/.* 200" && match -iP "Content-Length: 4[\r\n]" && match -iP "Content-Type: text/plain; charset=utf-8[\r\n]" && match -iP "X-Is-Head: false[\r\n]" && match -P "GET$" out=$(curl -v $base/method/get -I 2>&1); match "HTTP/.* 200" && match -iP "Content-Length: 4[\r\n]" && match -iP "Content-Type: text/plain; charset=utf-8[\r\n]" && match -iP "X-Is-Head: true[\r\n]" out=$(curl -v $base/method/head 2>&1); match "HTTP/.* 200" && match -iP "Content-Length: 5[\r\n]" && match -iP "Content-Type: text/plain; charset=utf-8[\r\n]" && match -iP "X-Is-Head: false[\r\n]" && match -P "HEAD$" -out=$(curl -v $base/method/head -I 2>&1); skipif "Server: ReactPHP" && match "HTTP/.* 200" && match -iP "Content-Length: 5[\r\n]" && match -iP "Content-Type: text/plain; charset=utf-8[\r\n]" && match -iP "X-Is-Head: true[\r\n]" # skip built-in webserver (always includes Content-Length : 0) +out=$(curl -v $base/method/head -I 2>&1); match "HTTP/.* 200" && match -iP "Content-Length: 5[\r\n]" && match -iP "Content-Type: text/plain; charset=utf-8[\r\n]" && match -iP "X-Is-Head: true[\r\n]" out=$(curl -v $base/etag/ 2>&1); match "HTTP/.* 200" && match -iP "Content-Length: 0[\r\n]" && match -iP "Etag: \"_\"" out=$(curl -v $base/etag/ -H 'If-None-Match: "_"' 2>&1); match "HTTP/.* 304" && notmatch -i "Content-Length" && match -iP "Etag: \"_\""