From 0b4378d462bf9e44afe71d8c87adf682dd116c50 Mon Sep 17 00:00:00 2001 From: Omair Majid Date: Mon, 23 Sep 2013 12:34:25 -0400 Subject: Unit tests for JNLPProxySelector This contains one functional change: - String host = uri.getSchemeSpecificPart().split(":")[0]; + String host = uri.getHost(); Given the URI of "socket://example.org", the first line evaluates to "//example.org", while the second one (correctly) evaluates to "example.org". --- plugin/icedteanp/java/sun/applet/PluginMain.java | 2 +- plugin/icedteanp/java/sun/applet/PluginProxySelector.java | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'plugin/icedteanp') diff --git a/plugin/icedteanp/java/sun/applet/PluginMain.java b/plugin/icedteanp/java/sun/applet/PluginMain.java index 3ceb119..3bfbfff 100644 --- a/plugin/icedteanp/java/sun/applet/PluginMain.java +++ b/plugin/icedteanp/java/sun/applet/PluginMain.java @@ -231,7 +231,7 @@ public class PluginMain { Authenticator.setDefault(new JNLPAuthenticator()); } // override the proxy selector set by JNLPRuntime - ProxySelector.setDefault(new PluginProxySelector()); + ProxySelector.setDefault(new PluginProxySelector(JNLPRuntime.getConfiguration())); } private static void setCookieHandler(PluginStreamHandler streamHandler) { diff --git a/plugin/icedteanp/java/sun/applet/PluginProxySelector.java b/plugin/icedteanp/java/sun/applet/PluginProxySelector.java index 32360fe..af6efc6 100644 --- a/plugin/icedteanp/java/sun/applet/PluginProxySelector.java +++ b/plugin/icedteanp/java/sun/applet/PluginProxySelector.java @@ -43,6 +43,7 @@ import java.net.URI; import java.util.ArrayList; import java.util.List; +import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.JNLPProxySelector; import net.sourceforge.jnlp.util.TimedHashMap; @@ -59,6 +60,10 @@ public class PluginProxySelector extends JNLPProxySelector { private TimedHashMap proxyCache = new TimedHashMap(); + public PluginProxySelector(DeploymentConfiguration config) { + super(config); + } + /** * Selects the appropriate proxy (or DIRECT connection method) for the given URI * -- cgit v1.2.3