General fixes for TLS
This was tested in airtime web and with integration of media-monitor and silan up and running. It might work for pypo but that needs testing.
This commit is contained in:
parent
7e68a68732
commit
4527b63c7b
|
@ -510,6 +510,10 @@ SQL;
|
|||
$serverPort = $_SERVER['SERVER_PORT'];
|
||||
$subDir = $CC_CONFIG['baseDir'];
|
||||
|
||||
if ($protocol === 'https' && $serverPort == 80) {
|
||||
$serverPort = 443;
|
||||
}
|
||||
|
||||
if ($subDir[0] === "/") {
|
||||
$subDir = substr($subDir, 1, strlen($subDir) - 1);
|
||||
}
|
||||
|
|
|
@ -186,8 +186,9 @@ class RequestProvider(object):
|
|||
self.requests = {}
|
||||
if self.config["general"]["base_dir"].startswith("/"):
|
||||
self.config["general"]["base_dir"] = self.config["general"]["base_dir"][1:]
|
||||
self.url = ApcUrl("http://%s:%s/%s%s/%s" \
|
||||
% (self.config["general"]["base_url"], str(self.config["general"]["base_port"]),
|
||||
self.url = ApcUrl("%s://%s:%s/%s%s/%s" \
|
||||
% (str(("https", "http")[self.config["general"]["base_port"] == 443]),
|
||||
self.config["general"]["base_url"], str(self.config["general"]["base_port"]),
|
||||
self.config["general"]["base_dir"], self.config["api_base"],
|
||||
'%%action%%'))
|
||||
# Now we must discover the possible actions
|
||||
|
@ -323,8 +324,9 @@ class AirtimeApiClient(object):
|
|||
# TODO : Make other methods in this class use this this method.
|
||||
if self.config["general"]["base_dir"].startswith("/"):
|
||||
self.config["general"]["base_dir"] = self.config["general"]["base_dir"][1:]
|
||||
url = "http://%s:%s/%s%s/%s" % \
|
||||
(self.config["general"]["base_url"], str(self.config["general"]["base_port"]),
|
||||
url = "%s://%s:%s/%s%s/%s" % \
|
||||
(str(("https", "http")[self.config["general"]["base_port"] == 443]),
|
||||
self.config["general"]["base_url"], str(self.config["general"]["base_port"]),
|
||||
self.config["general"]["base_dir"], self.config["api_base"],
|
||||
self.config[config_action_key])
|
||||
url = url.replace("%%api_key%%", self.config["general"]["api_key"])
|
||||
|
|
Loading…
Reference in New Issue