From a5043bd41c14986a0fb38c088a0d3ec08c39b42d Mon Sep 17 00:00:00 2001 From: Andreas Lutro Date: Fri, 5 May 2017 21:31:49 +0200 Subject: [PATCH] set CURLOPT_NOBODY on HEAD requests. fix #51 --- src/cURL.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cURL.php b/src/cURL.php index a0ca672..bc152ac 100644 --- a/src/cURL.php +++ b/src/cURL.php @@ -281,6 +281,10 @@ public function prepareRequest(Request $request) if ($this->methods[$method] === true) { curl_setopt($this->ch, CURLOPT_POSTFIELDS, $request->encodeData()); } + + if ($method === 'head') { + curl_setopt($this->ch, CURLOPT_NOBODY, true); + } } /**