aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBadlop <badlop@process-one.net>2008-05-12 17:56:27 +0000
committerBadlop <badlop@process-one.net>2008-05-12 17:56:27 +0000
commit98e47e8c73cdd0858357184dd105e284b69adde5 (patch)
tree03a5b2e4ea96e1b0af65bf8faf820fad82a537f2 /src
parent* src/mod_ip_blacklist.erl: Better error handling (EJAB-625). (diff)
* src/web/ejabberd_http.erl (parse_auth): Allow password that
include colon character (EJAB-522) SVN Revision: 1322
Diffstat (limited to 'src')
-rw-r--r--src/web/ejabberd_http.erl13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/web/ejabberd_http.erl b/src/web/ejabberd_http.erl
index 5c14a287b..a53910803 100644
--- a/src/web/ejabberd_http.erl
+++ b/src/web/ejabberd_http.erl
@@ -635,11 +635,14 @@ parse_auth(_Orig = "Basic " ++ Auth64) ->
{error, _Err} ->
undefined;
Auth ->
- case string:tokens(Auth, ":") of
- [User, Pass] ->
- {User, Pass};
- _ ->
- undefined
+ %% Auth should be a string with the format: user@server:password
+ %% Note that password can contain additional characters '@' and ':'
+ case string:chr(Auth, $:) of
+ 0 ->
+ undefined;
+ SplitIndex ->
+ {User, [$: | Pass]} = lists:split(SplitIndex-1, Auth),
+ {User, Pass}
end
end;
parse_auth(_) ->