Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.4.0

Bug #16827 Adding empty value for custom metadata causes signature to generate incorrectly
Submitted: 2009-11-24 01:41 UTC
From: gauthierm Assigned: gauthierm
Status: Closed Package: Services_Amazon_S3 (version CVS)
PHP Version: Irrelevant OS: Irrelevant
Roadmaps: (Not assigned)    
Subscription  


 [2009-11-24 01:41 UTC] gauthierm (Michael Gauthier)
Description: ------------ Amazon's string-to-sign ignores empty custom headers but Services_Amazon_S3 includes these in the stringToSign.

Comments

 [2009-12-02 04:55 UTC] doconnor (Daniel O'Connor)
More detail / test case?
 [2009-12-02 04:55 UTC] doconnor (Daniel O'Connor)
-Assigned To: +Assigned To: gauthierm
 [2009-12-04 02:41 UTC] gauthierm (Michael Gauthier)
Custom metadata is set on S3 objects using a "x-amz-meta-FOO" header. The S3 request signing collects all headers that start with "x-amz-" in the canonical string to sign. If custom metadata FOO is specified and the metadata value is empty, Amazon does not include the x-amz-meta-FOO header in the string to sign. The PEAR package includes these headers in the string to sign, causing the canonical strings to not match.
 [2009-12-04 03:08 UTC] gauthierm (Michael Gauthier)
Upon closer investigation, this appears to be a problem with headers set to null in php. HTTP_Request2 doesn't send headers set as null but the generated request signature includes headers set as null. Should be fairly easy to fix in the Services_Amazon_S3::sendRequest() method.
 [2009-12-04 03:13 UTC] gauthierm (Michael Gauthier)
-Status: Assigned +Status: Closed
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. Fixed in revision 291670. http://svn.php.net/viewvc?view=revision&revision=291670