summaryrefslogtreecommitdiff
path: root/Remote/S3.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-04-27 18:00:58 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-04-27 18:00:58 -0400
commitc32e51a706258a8be90c125475c6741d9b4936ad (patch)
treeab8a48c19f56dc6244f26b0e5c6030c72da0351c /Remote/S3.hs
parent454b6c96dee4b854decdcda78c6c2b11fd43c21b (diff)
S3: Fix incompatability with bucket names used by hS3; the aws library cannot handle upper-case bucket names. git-annex now converts them to lower case automatically.
For example, it failed to get files from a bucket named S3. Also fixes `git annex initremote UPPERCASE type=S3`, which failed with the new aws library, with a signing error message.
Diffstat (limited to 'Remote/S3.hs')
-rw-r--r--Remote/S3.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Remote/S3.hs b/Remote/S3.hs
index d290f9596..d8914d822 100644
--- a/Remote/S3.hs
+++ b/Remote/S3.hs
@@ -129,7 +129,7 @@ s3Setup' new u mcreds c = if configIA c then archiveorg else defaulthost
c' <- setRemoteCredPair noEncryptionUsed c (AWS.creds u) mcreds
-- Ensure user enters a valid bucket name, since
-- this determines the name of the archive.org item.
- let validbucket = replace " " "-" $ map toLower $
+ let validbucket = replace " " "-" $
fromMaybe (error "specify bucket=") $
getBucketName c'
let archiveconfig =
@@ -447,7 +447,7 @@ extractS3Info c = do
}
getBucketName :: RemoteConfig -> Maybe BucketName
-getBucketName = M.lookup "bucket"
+getBucketName = map toLower <$$> M.lookup "bucket"
getStorageClass :: RemoteConfig -> S3.StorageClass
getStorageClass c = case M.lookup "storageclass" c of