ZF-7990: URL endpoint setting is done AFTER authentification, it makes problems
Description
In Zend_Service_Amazon_S3 there is a small defect. You set endpoint after you do the authentication.
I attached the patch that fixes the problem.
--- .../library/Zend/Service/Amazon/S3.php (revision 18447)
+++ .../library/Zend/Service/Amazon/S3.php (working copy)
@@ -474,6 +474,7 @@
$client = self::getHttpClient();
$client->resetParameters();
+ $client->setUri($endpoint);
$client->setAuth(false);
// Work around buglet in HTTP client - it doesn't clean headers
// Remove when ZHC is fixed
@@ -482,7 +483,6 @@
'Range' => null,
'x-amz-acl' => null));
- $client->setUri($endpoint);
$client->setHeaders($headers);
Comments
Posted by Yegor Bugayenko (yegor256) on 2009-09-30T08:12:58.000+0000
This patch fixes the problem
Posted by Yegor Bugayenko (yegor256) on 2009-09-30T08:17:16.000+0000
Fatal error: Call to a member function setUsername() on a non-object in /code/ilks/php/src/library/Zend/Http/Client.php on line 545
This is what I get
Posted by Yegor Bugayenko (yegor256) on 2009-10-11T07:54:36.000+0000
this is a workaround I have to use for now:
in this scenario everything works fine
Posted by michael depetrillo (klassicd) on 2009-10-16T11:48:27.000+0000
set endpoint before authentication.