[Solar-svn] Revision 2971

pmjones at solarphp.com pmjones at solarphp.com
Wed Dec 12 15:36:21 CST 2007


Solar_Http_Request_Adapter_Curl: [FIX] Now correctly passes header values to curl.


Modified: trunk/Solar/Http/Request/Adapter/Curl.php
===================================================================
--- trunk/Solar/Http/Request/Adapter/Curl.php	2007-12-12 21:35:26 UTC (rev 2970)
+++ trunk/Solar/Http/Request/Adapter/Curl.php	2007-12-12 21:36:21 UTC (rev 2971)
@@ -131,8 +131,14 @@
         
         // set specialized headers and retain all others
         $http_header = array();
-        foreach ($headers as $label => $value) {
+        foreach ($headers as $header) {
+            $pos = strpos($header, ':');
+            $label = substr($header, 0, $pos);
+            $value = substr($header, $pos + 2);
             switch ($label) {
+            case 'Cookie':
+                curl_setopt($ch, CURLOPT_COOKIE, $value);
+                break;
             case 'User-Agent':
                 curl_setopt($ch, CURLOPT_USERAGENT, $value);
                 break;
@@ -140,7 +146,7 @@
                 curl_setopt($ch, CURLOPT_REFERER, $value);
                 break;
             default:
-                $http_header[] = "$label: $value";
+                $http_header[$label] = $value;
             }
         }
         




More information about the Solar-svn mailing list