Allow parsing of requests with no OAuth headers.

Project: http://git-wip-us.apache.org/repos/asf/couchdb-oauth/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-oauth/commit/cec39b1d
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-oauth/tree/cec39b1d
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-oauth/diff/cec39b1d

Branch: refs/heads/import
Commit: cec39b1d83d18988597a1fbbbb0858d8a43fdaf7
Parents: 7d85d3e
Author: Jan Lehnardt <[email protected]>
Authored: Fri Nov 26 14:28:09 2010 +0100
Committer: Jan Lehnardt <[email protected]>
Committed: Fri Nov 26 14:28:09 2010 +0100

----------------------------------------------------------------------
 src/oauth_uri.erl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-oauth/blob/cec39b1d/src/oauth_uri.erl
----------------------------------------------------------------------
diff --git a/src/oauth_uri.erl b/src/oauth_uri.erl
index c019427..5023f98 100644
--- a/src/oauth_uri.erl
+++ b/src/oauth_uri.erl
@@ -31,7 +31,7 @@ params_to_header_string(Params) ->
   intercalate(", ", [concat([encode(K), "=\"", encode(V), "\""]) || {K, V} <- 
Params]).
 
 params_from_header_string(String) ->
-  [param_from_header_string(Param) || Param <- re:split(String, ",\\s*", 
[{return, list}])].
+  [param_from_header_string(Param) || Param <- re:split(String, ",\\s*", 
[{return, list}]), Param =/= ""].
 
 param_from_header_string(Param) ->
   [Key, QuotedValue] = string:tokens(Param, "="),

Reply via email to