File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
main/java/io/kafbat/ui/config/auth
test/java/io/kafbat/ui/config/auth Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,8 @@ public class OAuthSecurityConfig extends AbstractAuthSecurityConfig {
6262 private final OAuthProperties properties ;
6363
6464 /**
65- * WebClient configured to use system proxy properties (-Dhttps.proxyHost, -Dhttps.proxyPort).
65+ * WebClient configured to use system proxy properties (http.proxyHost/https.proxyHost,
66+ * http.proxyPort/https.proxyPort, http.nonProxyHosts/https.nonProxyHosts).
6667 * Created as a bean to ensure system properties are read after context initialization.
6768 */
6869 @ Bean (name = "oauthWebClient" )
Original file line number Diff line number Diff line change @@ -96,6 +96,7 @@ public static synchronized void ensureStarted(boolean enableProxy) {
9696 initialized = true ;
9797 }
9898
99+ // Intentionally outside the initialized block - different tests may toggle proxy on/off
99100 // Set or clear proxy system properties based on enableProxy
100101 if (enableProxy ) {
101102 System .setProperty ("http.proxyHost" , "localhost" );
@@ -132,7 +133,9 @@ public static void resetServers() {
132133 }
133134 if (proxyServer != null ) {
134135 proxyServer .resetAll ();
135- // Re-stub proxy forwarding after reset
136+ }
137+ // Re-stub proxy forwarding after reset
138+ if (proxyServer != null && oauthServer != null ) {
136139 proxyServer .stubFor (WireMock .any (urlMatching (".*" ))
137140 .willReturn (aResponse ().proxiedFrom ("http://localhost:" + oauthServer .port ())));
138141 }
You can’t perform that action at this time.
0 commit comments