Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Don't convert response parameter keys to atoms.
  • Loading branch information
Tim Fletcher committed Aug 24, 2008
1 parent 933aafe commit 871055b1cf7f754285edf098d64d6341caaf9698
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
@@ -23,7 +23,7 @@ from_string(Data) ->
param_from_string(Data) when is_list(Data) ->
param_from_string(break_at($=, Data));
param_from_string({K, V}) ->
{list_to_atom(oauth_util:percent_decode(K)), oauth_util:percent_decode(V)}.
{oauth_util:percent_decode(K), oauth_util:percent_decode(V)}.

break_at(Sep, Chars) ->
case lists:splitwith(fun(C) -> C =/= Sep end, Chars) of
@@ -13,7 +13,7 @@ new(HttpResponse) ->
HttpResponse.

new_from_params(List) ->
new(get(oauth_token, List), get(oauth_token_secret, List)).
new(get("oauth_token", List), get("oauth_token_secret", List)).

get(Key, List) ->
proplists:get_value(Key, List).
@@ -7,8 +7,8 @@
params_from_string_test_() ->
% cf. http://oauth.net/core/1.0/#response_parameters (5.3)
Params = oauth_params:from_string("oauth_token=ab3cd9j4ks73hf7g&oauth_token_secret=xyz4992k83j47x0b"), [
?_assertEqual("ab3cd9j4ks73hf7g", proplists:get_value(oauth_token, Params)),
?_assertEqual("xyz4992k83j47x0b", proplists:get_value(oauth_token_secret, Params))
?_assertEqual("ab3cd9j4ks73hf7g", proplists:get_value("oauth_token", Params)),
?_assertEqual("xyz4992k83j47x0b", proplists:get_value("oauth_token_secret", Params))
].

params_to_header_string_test_() ->

0 comments on commit 871055b

Please sign in to comment.