Skip to content

Commit

Permalink
Unicode-aware handling of non-ASCII object keys in multipart uploads
Browse files Browse the repository at this point in the history
  • Loading branch information
shino committed Feb 12, 2014
1 parent dff637f commit 449d099
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/riak_cs_wm_object_upload.erl
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ process_post(RD, Ctx=#context{local_context=LocalCtx,
[{'xmlns', "http://s3.amazonaws.com/doc/2006-03-01/"}],
[
{'Bucket', [binary_to_list(Bucket)]},
{'Key', [Key]},
{'Key', [unicode:characters_to_list(list_to_binary(Key), unicode)]},
{'UploadId', [binary_to_list(base64url:encode(UploadId))]}
]
},
Expand Down
4 changes: 2 additions & 2 deletions src/riak_cs_wm_object_upload_part.erl
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ process_post(RD, Ctx=#context{local_context=LocalCtx,
[
{'Location', [lists:append(["http://", binary_to_list(Bucket), ".s3.amazonaws.com/", Key])]},
{'Bucket', [binary_to_list(Bucket)]},
{'Key', [Key]},
{'Key', [unicode:characters_to_list(list_to_binary(Key), unicode)]},
{'ETag', [binary_to_list(UploadId64)]}
]
},
Expand Down Expand Up @@ -296,7 +296,7 @@ to_xml(RD, Ctx=#context{local_context=LocalCtx,
[{'xmlns', "http://s3.amazonaws.com/doc/2006-03-01/"}],
[
{'Bucket', [binary_to_list(Bucket)]},
{'Key', [Key]},
{'Key', [unicode:characters_to_list(list_to_binary(Key), unicode)]},
{'UploadId', [binary_to_list(base64url:encode(UploadId))]},
{'Initiator', % TODO: replace with ARN data?
[{'ID', [UserKeyId]},
Expand Down

0 comments on commit 449d099

Please sign in to comment.