Permalink
Browse files

Fix keys prefixed with /

  • Loading branch information...
1 parent 59f6f68 commit e97a4d5e857817ea42b9111c039e0509c16b9997 @VictorNicollet committed Mar 31, 2013
Showing with 3 additions and 2 deletions.
  1. +3 −2 ohmAmazon/ohmAmazon.ml
View
@@ -253,6 +253,8 @@ module S3 = functor(Account:ACCOUNT) -> struct
let request ~verb ~bucket ?(key="") ?(qsa="") ?acl ?(storage=`Memory) ?contentType callback =
+ let key = BatString.strip ~chars:"/" key in
+
let verb_name = match verb with
| `GET -> "GET"
| `PUT _ | `PUTF _ -> "PUT"
@@ -278,7 +280,6 @@ module S3 = functor(Account:ACCOUNT) -> struct
let sign = sign (stringToSign) in
- let key = BatString.strip ~chars:"/" key in
let url = "http://"^bucket^".s3.amazonaws.com/"^key^qsa in
let call = match verb with
@@ -383,7 +384,7 @@ module S3 = functor(Account:ACCOUNT) -> struct
~verb:(`PUT data)
~bucket
~key
- begin fun call -> true end
+ begin fun call -> trueend
with Http_client.Http_protocol e ->
Util.log "Amazon.put: %s" (Printexc.to_string e) ; false

0 comments on commit e97a4d5

Please sign in to comment.