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 11# Change Log
22
3+ ## Unreleased
4+
5+ ### Fixed
6+
7+ - A HEAD request with the curl handler can be endless
38
49## 1.0.0 - 2016-07-18
510
Original file line number Diff line number Diff line change @@ -72,7 +72,8 @@ private function createRequest(RequestInterface $request)
7272
7373 $ options ['version ' ] = $ request ->getProtocolVersion ();
7474 $ options ['headers ' ] = $ request ->getHeaders ();
75- $ options ['body ' ] = (string ) $ request ->getBody ();
75+ $ body = (string ) $ request ->getBody ();
76+ $ options ['body ' ] = '' === $ body ? null : $ body ;
7677
7778 return $ this ->client ->createRequest (
7879 $ request ->getMethod (),
Original file line number Diff line number Diff line change 33namespace Http \Adapter \Guzzle5 \Tests ;
44
55use GuzzleHttp \Client as GuzzleClient ;
6+ use GuzzleHttp \Psr7 \Request ;
67use Http \Adapter \Guzzle5 \Client ;
78use Http \Client \Tests \HttpClientTest ;
89use Http \Message \MessageFactory \GuzzleMessageFactory ;
@@ -29,4 +30,16 @@ protected function createHttpAdapter()
2930 * @return object
3031 */
3132 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+ }
3245}
You can’t perform that action at this time.
0 commit comments