fixed some issues with luajit-request and luasec
This commit is contained in:
parent
a0848a649b
commit
2fb5c2387c
@ -1,19 +1,22 @@
|
||||
local bin = require("bin")
|
||||
local alpha = {}
|
||||
alpha.APIKey = ""
|
||||
local _,https = pcall(require,"ssl.https")
|
||||
local _,luajitrequest = pcall(require,"luajit-request")
|
||||
local loadedssl,https = pcall(require,"ssl.https")
|
||||
local loadedreq,luajitrequest = pcall(require,"luajit-request")
|
||||
local request
|
||||
if https then
|
||||
if loadedssl then
|
||||
function request(url)
|
||||
return https.request(url)
|
||||
end
|
||||
end
|
||||
if luajitrequest and not https then
|
||||
if loadedreq and not loadedssl then
|
||||
function request(url)
|
||||
return luajitrequest.send(url).body
|
||||
end
|
||||
end
|
||||
if request == nil then
|
||||
error("Was unable to load an ssl request library!")
|
||||
end
|
||||
function string:split(inSplitPattern, outResults)
|
||||
if not outResults then
|
||||
outResults = {}
|
||||
@ -708,4 +711,4 @@ function alpha.getSectorPreformance()
|
||||
end
|
||||
return c
|
||||
end
|
||||
return alpha
|
||||
return alpha
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user