From 32ab108bfdce3eafbb3f99a538f818a9fe771c25 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Tue, 17 Feb 2026 15:22:43 +0000 Subject: [PATCH] Move interesting JRE properties out of `checkJdkSettings` --- lib/start-proxy-action.js | 18 +++++++++--------- src/start-proxy/environment.ts | 22 +++++++++++----------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/lib/start-proxy-action.js b/lib/start-proxy-action.js index 32f7f65f3..27b1c1806 100644 --- a/lib/start-proxy-action.js +++ b/lib/start-proxy-action.js @@ -121832,6 +121832,14 @@ function checkEnvVar(logger, name) { return false; } } +var javaProperties = [ + "http.proxyHost", + "http.proxyPort", + "https.proxyHost", + "https.proxyPort", + "http.nonProxyHosts", + "java.net.useSystemProxies" +]; var JAVA_PROXY_ENV_VARS = [ "JAVA_TOOL_OPTIONS" /* JAVA_TOOL_OPTIONS */, "JDK_JAVA_OPTIONS" /* JDK_JAVA_OPTIONS */, @@ -121862,14 +121870,6 @@ function checkJdkSettings(logger, jdkHome) { // JDK 8 and below path3.join("lib", "net.properties") ]; - const properties = [ - "http.proxyHost", - "http.proxyPort", - "https.proxyHost", - "https.proxyPort", - "http.nonProxyHosts", - "java.net.useSystemProxies" - ]; for (const fileToCheck of filesToCheck) { const file = path3.join(jdkHome, fileToCheck); try { @@ -121877,7 +121877,7 @@ function checkJdkSettings(logger, jdkHome) { logger.debug(`Found '${file}'.`); const lines = String(fs2.readFileSync(file)).split("\n"); for (const line of lines) { - for (const property of properties) { + for (const property of javaProperties) { if (line.startsWith(`${property}=`)) { logger.info(`Found '${line.trimEnd()}' in '${file}'.`); } diff --git a/src/start-proxy/environment.ts b/src/start-proxy/environment.ts index 95977ed44..6ea53a9c2 100644 --- a/src/start-proxy/environment.ts +++ b/src/start-proxy/environment.ts @@ -30,6 +30,16 @@ function checkEnvVar(logger: Logger, name: string): boolean { } } +// The JRE properties that may affect the proxy. +const javaProperties = [ + "http.proxyHost", + "http.proxyPort", + "https.proxyHost", + "https.proxyPort", + "http.nonProxyHosts", + "java.net.useSystemProxies", +]; + /** Java-specific environment variables which may contain information about proxy settings. */ export const JAVA_PROXY_ENV_VARS: JavaEnvVars[] = [ JavaEnvVars.JAVA_TOOL_OPTIONS, @@ -83,16 +93,6 @@ export function checkJdkSettings(logger: Logger, jdkHome: string) { path.join("lib", "net.properties"), ]; - // The JRE properties that may affect the proxy. - const properties = [ - "http.proxyHost", - "http.proxyPort", - "https.proxyHost", - "https.proxyPort", - "http.nonProxyHosts", - "java.net.useSystemProxies", - ]; - for (const fileToCheck of filesToCheck) { const file = path.join(jdkHome, fileToCheck); @@ -102,7 +102,7 @@ export function checkJdkSettings(logger: Logger, jdkHome: string) { const lines = String(fs.readFileSync(file)).split("\n"); for (const line of lines) { - for (const property of properties) { + for (const property of javaProperties) { if (line.startsWith(`${property}=`)) { logger.info(`Found '${line.trimEnd()}' in '${file}'.`); }