Sun, 30 Nov 2008 17:34:47 +0100
Converting latin encoded responsed to utf-8 when needed.
util/sasl.lua | file | annotate | diff | comparison | revisions |
--- a/util/sasl.lua Sun Nov 30 17:18:31 2008 +0100 +++ b/util/sasl.lua Sun Nov 30 17:34:47 2008 +0100 @@ -132,6 +132,13 @@ if response["realm"] == nil then response["realm"] = "" end + if response["charset"] == nil then + response["username"] = latin1toutf8(response["username"]) + response["realm"] = latin1toutf8(response["realm"]) + elseif response["charset"] ~= "utf-8" then + return "failure", "incorrect-encoding", "The client's response uses "..response["charset"].." for encoding with isn't supported by sasl.lua. Supported encodings are latin or utf-8." + end + local domain = "" local protocol = "" if response["digest-uri"] then