mirror of
https://github.com/Mailu/Mailu.git
synced 2025-01-18 03:21:36 +02:00
Fix #3364
(cherry picked from commit ee243ea735744b296bb90b2c1e6a1fded8915c8d)
This commit is contained in:
parent
30734b49aa
commit
3d4a9ac29c
@ -10,15 +10,24 @@ local http_client = dovecot.http.client {
|
||||
max_attempts = 3;
|
||||
}
|
||||
|
||||
-- on the other end we use urllib.parse.unquote()
|
||||
function urlEncode(str)
|
||||
return str:gsub("[^%w_.-~]", function(c)
|
||||
return string.format("%%%02X", string.byte(c))
|
||||
end)
|
||||
end
|
||||
|
||||
function auth_passdb_lookup(req)
|
||||
local auth_request = http_client:request {
|
||||
url = "http://{{ ADMIN_ADDRESS }}:8080/internal/auth/email";
|
||||
}
|
||||
auth_request:add_header('Auth-Port', req.local_port)
|
||||
auth_request:add_header('Auth-User', req.user)
|
||||
local user = urlEncode(req.user)
|
||||
auth_request:add_header('Auth-User', user)
|
||||
if req.password ~= nil
|
||||
then
|
||||
auth_request:add_header('Auth-Pass', req.password)
|
||||
local password = urlEncode(req.password)
|
||||
auth_request:add_header('Auth-Pass', password)
|
||||
end
|
||||
auth_request:add_header('Auth-Protocol', req.service)
|
||||
auth_request:add_header('Client-IP', req.remote_ip)
|
||||
|
1
towncrier/newsfragments/3364.bugfix
Normal file
1
towncrier/newsfragments/3364.bugfix
Normal file
@ -0,0 +1 @@
|
||||
Fix a bug preventing percent characters from being used in passwords
|
Loading…
x
Reference in New Issue
Block a user