Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

Commit

Permalink
AWS signature fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bwbuchanan committed Oct 17, 2010
1 parent ac0a2bd commit 6446668
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/erlcloud_aws.erl
Expand Up @@ -17,7 +17,7 @@ aws_request(Method, Host, Path, Params, AccessKeyID, SecretAccessKey) ->

QueryToSign = erlcloud_http:make_query_string(QParams),
RequestToSign = [string:to_upper(atom_to_list(Method)), $\n,
Host, $\n, Path, $\n, QueryToSign],
string:to_lower(Host), $\n, Path, $\n, QueryToSign],
Signature = base64:encode(crypto:sha_mac(SecretAccessKey, RequestToSign)),

Query = [QueryToSign, "&Signature=", erlcloud_http:url_encode(Signature)],
Expand Down
3 changes: 1 addition & 2 deletions src/erlcloud_http.erl
Expand Up @@ -20,8 +20,7 @@ url_encode([Char|String], Accum)
Char >= $a, Char =< $z;
Char >= $0, Char =< $9;
Char =:= $-; Char =:= $_;
Char =:= $.; Char =:= $~;
Char =:= $: ->
Char =:= $.; Char =:= $~ ->
url_encode(String, [Char|Accum]);
url_encode([Char|String], Accum)
when Char >=0, Char =< 255 ->
Expand Down

0 comments on commit 6446668

Please sign in to comment.