fix timeout configuration for HTTPS LAPI (#15)

This commit is contained in:
blotus 2021-11-02 10:28:45 +01:00 committed by GitHub
parent 3e8c308bce
commit b23acef8f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -84,6 +84,7 @@ function csmod.allowIp(ip)
local one, body, code, headers, status
if link:find("https://") == 1 then
https.TIMEOUT = runtime.conf['REQUEST_TIMEOUT']
one, code, headers, status = https.request{
url = link,
headers = {
@ -95,12 +96,7 @@ function csmod.allowIp(ip)
sink = ltn12.sink.table(resp),
protocol = "tlsv1",
options = "all",
verify = "none",
create = function()
local req_sock = socket.tcp()
req_sock:settimeout(runtime.conf['REQUEST_TIMEOUT'], 't')
return req_sock
end
verify = "none"
}
else
body, code, headers = http.request{