From 2cea057b4bafe2ed2fbf20b0da52b084f37658dc Mon Sep 17 00:00:00 2001 From: Chuck Hagenbuch Date: Sun, 27 Sep 2009 12:25:10 -0400 Subject: [PATCH] fix Curl requests defaulting to POST instead of GET (and otherwise ignoring the request method) --- framework/Http/lib/Horde/Http/Request/Curl.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/framework/Http/lib/Horde/Http/Request/Curl.php b/framework/Http/lib/Horde/Http/Request/Curl.php index 0b1ac8805..56ddefa49 100644 --- a/framework/Http/lib/Horde/Http/Request/Curl.php +++ b/framework/Http/lib/Horde/Http/Request/Curl.php @@ -36,6 +36,7 @@ class Horde_Http_Request_Curl extends Horde_Http_Request_Base curl_setopt($curl, CURLOPT_URL, $this->uri); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_HEADER, true); + curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $this->method); $data = $this->data; if (is_array($data)) { @@ -44,7 +45,7 @@ class Horde_Http_Request_Curl extends Horde_Http_Request_Base // POST data isn't passed. $data = http_build_query($data); } - curl_setopt($curl, CURLOPT_POSTFIELDS, $this->data); + if ($data) { curl_setopt($curl, CURLOPT_POSTFIELDS, $data); } $result = curl_exec($curl); if ($result === false) { -- 2.11.0