Add the headers array to the Curl request
authorMichael J. Rubinsky <mrubinsk@horde.org>
Sun, 27 Sep 2009 17:11:30 +0000 (13:11 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Sun, 27 Sep 2009 17:11:30 +0000 (13:11 -0400)
framework/Http/lib/Horde/Http/Request/Curl.php

index 56ddefa..86a4642 100644 (file)
@@ -47,6 +47,13 @@ class Horde_Http_Request_Curl extends Horde_Http_Request_Base
         }
         if ($data) { curl_setopt($curl, CURLOPT_POSTFIELDS, $data); }
 
+        // Concatenate the headers
+        $hdr = array();
+        foreach ($this->headers as $header => $value) {
+            $hdr[] = $header . ': ' . $value;
+        }
+        curl_setopt($curl, CURLOPT_HTTPHEADER, $hdr);
+
         $result = curl_exec($curl);
         if ($result === false) {
             throw new Horde_Http_Exception(curl_error($curl), curl_errno($curl));