always use certs, add http if no protocol specified
This commit is contained in:
parent
ffcd63fc91
commit
f352e9bf62
|
@ -46,10 +46,8 @@ function VideoContent(video) as object
|
|||
|
||||
' todo - audioFormat is read only
|
||||
video.content.audioFormat = getAudioFormat(meta)
|
||||
video.content.setCertificatesFile("common:/certs/ca-bundle.crt")
|
||||
|
||||
if server_is_https() then
|
||||
video.content.setCertificatesFile("common:/certs/ca-bundle.crt")
|
||||
end if
|
||||
return video
|
||||
end function
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ end function
|
|||
|
||||
function buildURL(path as String, params={} as Object) as string
|
||||
|
||||
full_url = get_url() + path
|
||||
full_url = get_url() + "/" + path
|
||||
if params.count() > 0
|
||||
full_url = full_url + "?" + buildParams(params)
|
||||
end if
|
||||
|
@ -46,15 +46,10 @@ end function
|
|||
|
||||
function APIRequest(url as String, params={} as Object)
|
||||
req = createObject("roUrlTransfer")
|
||||
|
||||
if server_is_https() then
|
||||
req.setCertificatesFile("common:/certs/ca-bundle.crt")
|
||||
end if
|
||||
req.setCertificatesFile("common:/certs/ca-bundle.crt")
|
||||
|
||||
full_url = buildURL(url, params)
|
||||
|
||||
req.setUrl(full_url)
|
||||
|
||||
req = authorize_request(req)
|
||||
|
||||
return req
|
||||
|
@ -100,16 +95,15 @@ end function
|
|||
|
||||
function get_url()
|
||||
base = get_setting("server")
|
||||
|
||||
if base.right(1) <> "/"
|
||||
base = base + "/"
|
||||
if base.right(1) = "/"
|
||||
base = base.left(base.len() - 1)
|
||||
end if
|
||||
|
||||
' append http:// to the start if not specified
|
||||
if base.left(5) <> "https" or <> "http:"
|
||||
base = "http://" + base
|
||||
return base
|
||||
end function
|
||||
|
||||
function server_is_https() as Boolean
|
||||
return True
|
||||
end function
|
||||
|
||||
function authorize_request(request)
|
||||
|
|
Loading…
Reference in New Issue
Block a user