Commit ec730ab5 authored by Bas de Nooijer's avatar Bas de Nooijer

Bugfix for double requests in the curl adapter

parent 5cb001f4
...@@ -173,14 +173,10 @@ class Curl extends Configurable implements AdapterInterface ...@@ -173,14 +173,10 @@ class Curl extends Configurable implements AdapterInterface
} else { } else {
curl_setopt($handler, CURLOPT_POSTFIELDS, $request->getRawData()); curl_setopt($handler, CURLOPT_POSTFIELDS, $request->getRawData());
} }
$httpResponse = curl_exec($handler);
} elseif ($method == Request::METHOD_GET) { } elseif ($method == Request::METHOD_GET) {
curl_setopt($handler, CURLOPT_HTTPGET, true); curl_setopt($handler, CURLOPT_HTTPGET, true);
$httpResponse = curl_exec($handler);
} elseif ($method == Request::METHOD_HEAD) { } elseif ($method == Request::METHOD_HEAD) {
curl_setopt($handler, CURLOPT_CUSTOMREQUEST, 'HEAD'); curl_setopt($handler, CURLOPT_CUSTOMREQUEST, 'HEAD');
$httpResponse = curl_exec($handler);
} else { } else {
throw new InvalidArgumentException("unsupported method: $method"); throw new InvalidArgumentException("unsupported method: $method");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment