Kaynağa Gözat

Merge branch 'kynx-hotfix/67'
Close #71

Rob Allen 12 yıl önce
ebeveyn
işleme
5520388980

+ 5 - 0
library/Zend/Service/Rackspace/Abstract.php

@@ -329,6 +329,11 @@ abstract class Zend_Service_Rackspace_Abstract
     {
         $client = $this->getHttpClient();
         $client->resetParameters(true);
+        if ($method == 'PUT' && empty($body)) {
+            // if left at NULL a PUT request will always have 
+            // Content-Type: x-url-form-encoded, which breaks copyObject()
+            $client->setEncType(''); 
+        }
         if (empty($headers[self::AUTHUSER_HEADER])) {
             $headers[self::AUTHTOKEN]= $this->getToken();
         } 

+ 1 - 0
tests/Zend/Service/Rackspace/Files/OfflineTest.php

@@ -212,6 +212,7 @@ class Zend_Service_Rackspace_Files_OfflineTest
             'zf-object-test' . '-copy'
         );
         $this->assertTrue($result);
+        $this->assertNotContains('application/x-www-form-urlencoded', $this->rackspace->getHttpClient()->getLastRequest());
     }
 
     public function testGetObjects()