openvidu-server: allow deprecated OPENVIDU_DOMAIN_OR_PUBLIC_IP

pull/473/head
pabloFuente 2020-05-04 19:15:00 +02:00
parent 98957f4bb6
commit ae5087e373
1 changed files with 8 additions and 1 deletions

View File

@ -554,10 +554,17 @@ public class OpenviduConfig {
final String property = "DOMAIN_OR_PUBLIC_IP"; final String property = "DOMAIN_OR_PUBLIC_IP";
String domain = asOptionalInetAddress(property); String domain = asOptionalInetAddress(property);
// TODO: remove when possible deprecated OPENVIDU_DOMAIN_OR_PUBLIC_IP
if (domain == null || domain.isEmpty()) {
domain = asOptionalInetAddress("OPENVIDU_DOMAIN_OR_PUBLIC_IP");
this.configProps.put("DOMAIN_OR_PUBLIC_IP", domain);
this.configProps.remove("OPENVIDU_DOMAIN_OR_PUBLIC_IP");
}
if (domain != null && !domain.isEmpty()) { if (domain != null && !domain.isEmpty()) {
this.domainOrPublicIp = domain; this.domainOrPublicIp = domain;
this.openviduPublicUrl = "https://" + domain; this.openviduPublicUrl = "https://" + domain;
if (this.httpsPort != 443) { if (this.httpsPort != null && this.httpsPort != 443) {
this.openviduPublicUrl += (":" + this.httpsPort); this.openviduPublicUrl += (":" + this.httpsPort);
} }
calculatePublicUrl(); calculatePublicUrl();