]> source.dussan.org Git - nextcloud-server.git/commit
Fix Signiture Does Not Match when mounting Amazon S3 external storage
authorChristopher T. Johnson <ctjctj@gmail.com>
Mon, 14 Apr 2014 13:49:43 +0000 (09:49 -0400)
committerThomas Müller <thomas.mueller@tmit.eu>
Tue, 8 Jul 2014 12:37:55 +0000 (14:37 +0200)
commit3c3ebd5cf99e2d97d4f3de7c9a2434c71f194a2d
tree5dadef66d7af60e8e945ae5dbd17eefed87d71ea
parent3bec0dc4f115ca4273cc76ac344f733842c4a43c
Fix Signiture Does Not Match when mounting Amazon S3 external storage

For some reason the aws-sdk-php package does not caclulate the
signiture correctly when accessing an object in a bucket with a name of
'.'.

When we are at the top of a S3 bucket there is a need(?) to have a directory
name.  Per standard Unix the name picked was '.' (dot or period).  This
choice exercises the aws-sdk bug.

This fix is to add a field to the method to store the name to use instead of
'.' which at this point is hard coded to '<root>'.  We also add a private
function 'cleanKey()' which will test for the '.' name and replace it with
the variable.  Finally all calls to manipulate objects where the path is
not obviously not '.' are processed through cleanKey().

An example where we don't process through clean key would be
'Key' => $path.'/',

Use correct relationship operator

Per feed back use === instead of ==

use '/' instead of '<root>'
apps/files_external/lib/amazons3.php