This repository was archived by the owner on Jan 6, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 1
1
# Change Log
2
2
3
+ ## Unreleased
4
+
5
+ ### Fixed
6
+
7
+ - A HEAD request with the curl handler can be endless
3
8
4
9
## 1.0.0 - 2016-07-18
5
10
Original file line number Diff line number Diff line change @@ -72,7 +72,8 @@ private function createRequest(RequestInterface $request)
72
72
73
73
$ options ['version ' ] = $ request ->getProtocolVersion ();
74
74
$ options ['headers ' ] = $ request ->getHeaders ();
75
- $ options ['body ' ] = (string ) $ request ->getBody ();
75
+ $ body = (string ) $ request ->getBody ();
76
+ $ options ['body ' ] = '' === $ body ? null : $ body ;
76
77
77
78
return $ this ->client ->createRequest (
78
79
$ request ->getMethod (),
Original file line number Diff line number Diff line change 3
3
namespace Http \Adapter \Guzzle5 \Tests ;
4
4
5
5
use GuzzleHttp \Client as GuzzleClient ;
6
+ use GuzzleHttp \Psr7 \Request ;
6
7
use Http \Adapter \Guzzle5 \Client ;
7
8
use Http \Client \Tests \HttpClientTest ;
8
9
use Http \Message \MessageFactory \GuzzleMessageFactory ;
@@ -29,4 +30,16 @@ protected function createHttpAdapter()
29
30
* @return object
30
31
*/
31
32
abstract protected function createHandler ();
33
+
34
+ /**
35
+ * @group integration
36
+ * @group network
37
+ */
38
+ public function testHeadRequestShouldEnd ()
39
+ {
40
+ // It works with the PHP Built-in web server via $request = new Request('GET', $this->getUri());
41
+ $ request = new Request ('HEAD ' , 'https://httpbin.org/ ' );
42
+ $ this ->httpAdapter ->sendRequest ($ request );
43
+ $ this ->addToAssertionCount (1 );
44
+ }
32
45
}
You can’t perform that action at this time.
0 commit comments