Skip to content

Commit f178760

Browse files
authored
Merge pull request #113 from clue-labs/new-http
Update to improve protocol handling for HTTP responses with no body
2 parents 0199815 + 7f8fc65 commit f178760

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"require": {
1414
"php": ">=7.1",
1515
"nikic/fast-route": "^1.3",
16-
"react/http": "^1.5",
16+
"react/http": "^1.6",
1717
"react/promise": "^2.7"
1818
},
1919
"require-dev": {

tests/acceptance.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ out=$(curl -v $base/method -X OPTIONS 2>&1); match "HTTP/.* 200" && match "OP
9999
out=$(curl -v $base -X OPTIONS --request-target "*" 2>&1); skipif "Server: nginx" && match "HTTP/.* 200" # skip nginx (400)
100100

101101
out=$(curl -v $base/etag/ 2>&1); match "HTTP/.* 200" && match -iP "Content-Length: 0[\r\n]" && match -iP "Etag: \"_\""
102-
out=$(curl -v $base/etag/ -H 'If-None-Match: "_"' 2>&1); skipif "Server: ReactPHP" && match "HTTP/.* 304" && notmatch -i "Content-Length" && match -iP "Etag: \"_\"" # skip built-in webserver (always includes Content-Length : 0)
102+
out=$(curl -v $base/etag/ -H 'If-None-Match: "_"' 2>&1); match "HTTP/.* 304" && notmatch -i "Content-Length" && match -iP "Etag: \"_\""
103103
out=$(curl -v $base/etag/a 2>&1); match "HTTP/.* 200" && match -iP "Content-Length: 2[\r\n]" && match -iP "Etag: \"a\""
104-
out=$(curl -v $base/etag/a -H 'If-None-Match: "a"' 2>&1); skipif "Server: ReactPHP" && skipif "Server: Apache" && match "HTTP/.* 304" && match -iP "Content-Length: 2[\r\n]" && match -iP "Etag: \"a\"" # skip built-in webserver (always includes Content-Length: 0) and Apache (no Content-Length)
104+
out=$(curl -v $base/etag/a -H 'If-None-Match: "a"' 2>&1); skipif "Server: Apache" && match "HTTP/.* 304" && match -iP "Content-Length: 2[\r\n]" && match -iP "Etag: \"a\"" # skip Apache (no Content-Length)
105105

106106
out=$(curl -v $base/headers -H 'Accept: text/html' 2>&1); match "HTTP/.* 200" && match "\"Accept\": \"text/html\""
107107
out=$(curl -v $base/headers -d 'name=Alice' 2>&1); match "HTTP/.* 200" && match "\"Content-Type\": \"application/x-www-form-urlencoded\"" && match "\"Content-Length\": \"10\""

0 commit comments

Comments
 (0)