Skip to content

Commit

Permalink
Merge pull request esl#6 from fabiankrol/master
Browse files Browse the repository at this point in the history
 store s3 user-defined metadata
  • Loading branch information
gleber committed Oct 3, 2012
2 parents 7a34c25 + f902111 commit e00284d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/erlcloud_s3.erl
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ get_object_metadata(BucketName, Key, Options, Config) ->
{version_id, proplists:get_value("x-amz-version-id", Headers, "false")}|extract_metadata(Headers)].

extract_metadata(Headers) ->
[{Key, Value} || {["x-amz-meta-"|Key], Value} <- Headers].
[{Key, Value} || {Key = "x-amz-meta-" ++ _, Value} <- Headers].

-spec get_object_torrent(string(), string()) -> proplist().

Expand Down Expand Up @@ -545,7 +545,7 @@ put_object(BucketName, Key, Value, Options, HTTPHeaders, Config)
when is_list(BucketName), is_list(Key), is_list(Value) orelse is_binary(Value),
is_list(Options) ->
RequestHeaders = [{"x-amz-acl", encode_acl(proplists:get_value(acl, Options))}|HTTPHeaders]
++ [{["x-amz-meta-"|string:to_lower(MKey)], MValue} ||
++ [{"x-amz-meta-" ++ string:to_lower(MKey), MValue} ||
{MKey, MValue} <- proplists:get_value(meta, Options, [])],
ContentType = proplists:get_value("content-type", HTTPHeaders, "application/octet_stream"),
POSTData = {iolist_to_binary(Value), ContentType},
Expand Down

0 comments on commit e00284d

Please sign in to comment.