aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOkash Khawaja <okash.khawaja@gmail.com>2016-04-12 00:04:21 +0100
committerOkash Khawaja <okash.khawaja@gmail.com>2016-04-12 00:04:21 +0100
commitb9f6fd215a8f522733caedcb4d6d6b0c6e55103e (patch)
treea93ff159aae465af85a8864c3e3616d0976d36df
parent9984741d94772be1484033d711c1a674da38217a (diff)
downloadluasocket-b9f6fd215a8f522733caedcb4d6d6b0c6e55103e.tar.gz
luasocket-b9f6fd215a8f522733caedcb4d6d6b0c6e55103e.tar.bz2
luasocket-b9f6fd215a8f522733caedcb4d6d6b0c6e55103e.zip
URL-decode user password before adding to authorization header.
-rw-r--r--src/http.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/http.lua b/src/http.lua
index f2fff01..a386165 100644
--- a/src/http.lua
+++ b/src/http.lua
@@ -222,7 +222,8 @@ local function adjustheaders(reqt)
222 -- if we have authentication information, pass it along 222 -- if we have authentication information, pass it along
223 if reqt.user and reqt.password then 223 if reqt.user and reqt.password then
224 lower["authorization"] = 224 lower["authorization"] =
225 "Basic " .. (mime.b64(reqt.user .. ":" .. reqt.password)) 225 "Basic " .. (mime.b64(reqt.user .. ":" ..
226 url.unescape(reqt.password)))
226 end 227 end
227 -- if we have proxy authentication information, pass it along 228 -- if we have proxy authentication information, pass it along
228 local proxy = reqt.proxy or _M.PROXY 229 local proxy = reqt.proxy or _M.PROXY