ZF-7990: URL endpoint setting is done AFTER authentification, it makes problems

Issue Type: Bug Created: 2009-09-30T08:11:39.000+0000 Last Updated: 2009-10-16T11:48:29.000+0000 Status: Resolved Fix version(s): Reporter: Yegor Bugayenko (yegor256) Assignee: michael depetrillo (klassicd) Tags: - Zend_Service_Amazon

Related issues: - ZF-8060

Attachments: - S3.patch


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.

<pre class="highlight">
--- .../library/Zend/Service/Amazon/S3.php  (revision 18447)
+++ .../library/Zend/Service/Amazon/S3.php  (working copy)
@@ -474,6 +474,7 @@
         $client = self::getHttpClient();
+        $client->setUri($endpoint);
         // 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);


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:

    $s3 = new Zend_Service_Amazon_S3($key, $secret);    
    Zend_Service_Amazon_S3::getHttpClient()->setUri('<a rel="nofollow" href=""></a>');
    return $s3;

in this scenario everything works fine

Posted by michael depetrillo (klassicd) on 2009-10-16T11:48:27.000+0000

set endpoint before authentication.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.