Browse Source

Don't convert response parameter keys to atoms.

Tim Fletcher 17 years ago
parent
commit
871055b1cf
3 changed files with 4 additions and 4 deletions
  1. 1 1
      src/oauth_params.erl
  2. 1 1
      src/oauth_token_pair.erl
  3. 2 2
      src/oauth_unit.erl

+ 1 - 1
src/oauth_params.erl

@@ -23,7 +23,7 @@ from_string(Data) ->
 param_from_string(Data) when is_list(Data) ->
 param_from_string(Data) when is_list(Data) ->
   param_from_string(break_at($=, Data));
   param_from_string(break_at($=, Data));
 param_from_string({K, V}) ->
 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) ->
 break_at(Sep, Chars) ->
   case lists:splitwith(fun(C) -> C =/= Sep end, Chars) of
   case lists:splitwith(fun(C) -> C =/= Sep end, Chars) of

+ 1 - 1
src/oauth_token_pair.erl

@@ -13,7 +13,7 @@ new(HttpResponse) ->
   HttpResponse.
   HttpResponse.
 
 
 new_from_params(List) ->
 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) ->
 get(Key, List) ->
   proplists:get_value(Key, List).
   proplists:get_value(Key, List).

+ 2 - 2
src/oauth_unit.erl

@@ -7,8 +7,8 @@
 params_from_string_test_() ->
 params_from_string_test_() ->
   % cf. http://oauth.net/core/1.0/#response_parameters (5.3)
   % cf. http://oauth.net/core/1.0/#response_parameters (5.3)
   Params = oauth_params:from_string("oauth_token=ab3cd9j4ks73hf7g&oauth_token_secret=xyz4992k83j47x0b"), [
   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_() ->
 params_to_header_string_test_() ->