Add assert for login/password
parent
1c78a3703a
commit
0182a4676a
|
@ -20,6 +20,8 @@ local decode_authorization = function(header)
|
||||||
local auth_string_b64 = string.match(header, "^Basic%s([^%s]+)$")
|
local auth_string_b64 = string.match(header, "^Basic%s([^%s]+)$")
|
||||||
local auth_string, _ = mime.unb64(auth_string_b64)
|
local auth_string, _ = mime.unb64(auth_string_b64)
|
||||||
local login, password = string.match(auth_string, "^([^:]+)[:](.+)$")
|
local login, password = string.match(auth_string, "^([^:]+)[:](.+)$")
|
||||||
|
assert(login ~= nil and login ~= "", [[Login empty!]])
|
||||||
|
assert(password ~= nil and password ~= "", [[Password empty!]])
|
||||||
return login, password
|
return login, password
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue