From 5a23a0b723019ea530e66f734ac703ad3627c34b Mon Sep 17 00:00:00 2001 From: michaeloffner Date: Fri, 13 Dec 2024 13:46:44 +0100 Subject: [PATCH] LDEV-5043 - allow alias for proxy settings --- .../runtime/config/ConfigWebFactory.java | 24 ++++++++++++++----- loader/build.xml | 2 +- loader/pom.xml | 2 +- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/core/src/main/java/lucee/runtime/config/ConfigWebFactory.java b/core/src/main/java/lucee/runtime/config/ConfigWebFactory.java index 518b8550cb..734124a24d 100644 --- a/core/src/main/java/lucee/runtime/config/ConfigWebFactory.java +++ b/core/src/main/java/lucee/runtime/config/ConfigWebFactory.java @@ -5405,12 +5405,24 @@ private static void _loadProxy(ConfigServerImpl configServer, ConfigImpl config, boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); Struct proxy = ConfigWebUtil.getAsStruct("proxy", root); - // proxy server - boolean enabled = Caster.toBooleanValue(getAttr(proxy, "enabled"), true); - String server = getAttr(proxy, "server"); - String username = getAttr(proxy, "username"); - String password = getAttr(proxy, "password"); - int port = Caster.toIntValue(getAttr(proxy, "port"), -1); + boolean enabled = false; + String server = null, username = null, password = null; + int port = -1; + if (proxy != null && proxy.size() > 0) { + enabled = Caster.toBooleanValue(getAttr(proxy, "enabled"), true); + server = getAttr(proxy, "server"); + username = getAttr(proxy, "username"); + password = getAttr(proxy, "password"); + port = Caster.toIntValue(getAttr(proxy, "port"), -1); + } + if (StringUtil.isEmpty(server, true)) { + server = getAttr(root, "updateProxyHost"); + username = getAttr(root, "updateProxyUsername"); + password = getAttr(root, "updateProxyPassword"); + port = Caster.toIntValue(getAttr(root, "updateProxyPort"), -1); + enabled = !StringUtil.isEmpty(server, true); + + } // includes/excludes Set includes = proxy != null ? ProxyDataImpl.toStringSet(getAttr(proxy, "includes")) : null; diff --git a/loader/build.xml b/loader/build.xml index 9389ead0f1..197e25f2b4 100644 --- a/loader/build.xml +++ b/loader/build.xml @@ -2,7 +2,7 @@ - + diff --git a/loader/pom.xml b/loader/pom.xml index b2e15a3cd9..b81a04188e 100644 --- a/loader/pom.xml +++ b/loader/pom.xml @@ -3,7 +3,7 @@ org.lucee lucee - 6.1.2.9-SNAPSHOT + 6.1.2.10-SNAPSHOT jar Lucee Loader Build