diff options
author | Markus Keller | 2016-10-13 15:46:49 +0000 |
---|---|---|
committer | Dani Megert | 2016-10-15 14:04:57 +0000 |
commit | a4fb61b98bec0b2ef52afbe248f21b0195781dbf (patch) | |
tree | c7dd90d9bc25bf8846ad98161b51dd739cadd65e /bundles | |
parent | b5c052a00231a41f5cf4161f556d2cf99cb740cf (diff) | |
download | eclipse.platform.team-a4fb61b98bec0b2ef52afbe248f21b0195781dbf.tar.gz eclipse.platform.team-a4fb61b98bec0b2ef52afbe248f21b0195781dbf.tar.xz eclipse.platform.team-a4fb61b98bec0b2ef52afbe248f21b0195781dbf.zip |
Bug 505906: UnixProxyProvider's support for no_proxy environmentY20161018-1100I20161018-0800
variable is non-standard
Change-Id: I501d19073526f796d05892f2557ed63f4f59cf4a
Signed-off-by: Markus Keller <markus_keller@ch.ibm.com>
Diffstat (limited to 'bundles')
4 files changed, 9 insertions, 16 deletions
diff --git a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyManager.java b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyManager.java index 981b4906d..34a5f8c69 100644 --- a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyManager.java +++ b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyManager.java @@ -333,17 +333,12 @@ public class ProxyManager implements IProxyService, IPreferenceChangeListener { String[] filters = getNonProxiedHosts(); for (int i = 0; i < filters.length; i++) { String filter = filters[i]; - if (matchesFilter(uri.getHost(), filter)) + if (StringUtil.hostMatchesFilter(uri.getHost(), filter)) return true; } return false; } - private boolean matchesFilter(String host, String filter) { - StringMatcher matcher = new StringMatcher(filter, true, false); - return matcher.match(host); - } - /* (non-Javadoc) * @see org.eclipse.net.core.IProxyManager#getProxyDataForHost(java.lang.String, java.lang.String) */ diff --git a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/StringUtil.java b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/StringUtil.java index 5746f2abd..71a2d3d50 100644 --- a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/StringUtil.java +++ b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/StringUtil.java @@ -100,4 +100,10 @@ public class StringUtil { return buffer.toString(); } + public static boolean hostMatchesFilter(String host, String filter) { + String suffixMatchingFilter = "*" + filter; //$NON-NLS-1$ + StringMatcher matcher = new StringMatcher(suffixMatchingFilter, true, false); + return matcher.match(host); + } + }
\ No newline at end of file diff --git a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/unix/UnixProxyProvider.java b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/unix/UnixProxyProvider.java index 572c90275..9faffce49 100644 --- a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/unix/UnixProxyProvider.java +++ b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/unix/UnixProxyProvider.java @@ -23,7 +23,6 @@ import org.eclipse.core.internal.net.AbstractProxyProvider; import org.eclipse.core.internal.net.Activator; import org.eclipse.core.internal.net.Policy; import org.eclipse.core.internal.net.ProxyData; -import org.eclipse.core.internal.net.StringMatcher; import org.eclipse.core.internal.net.StringUtil; import org.eclipse.core.net.proxy.IProxyData; @@ -56,7 +55,7 @@ public class UnixProxyProvider extends AbstractProxyProvider { if (nonProxyHosts != null) { String host = uri.getHost(); for (int npIndex = 0; npIndex < nonProxyHosts.length; npIndex++) { - if (matchesFilter(host, nonProxyHosts[npIndex])) { + if (StringUtil.hostMatchesFilter(host, nonProxyHosts[npIndex])) { return new IProxyData[0]; } } @@ -270,11 +269,6 @@ public class UnixProxyProvider extends AbstractProxyProvider { System.out.println(i + ": " + strs[i]); //$NON-NLS-1$ } - private boolean matchesFilter(String host, String filter) { - StringMatcher matcher = new StringMatcher(filter, true, false); - return matcher.match(host); - } - protected static native void gconfInit(); protected static native ProxyData getGConfProxyInfo(String protocol); diff --git a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/ProxyBypass.java b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/ProxyBypass.java index 98e8255e7..1a960d8e8 100644 --- a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/ProxyBypass.java +++ b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/ProxyBypass.java @@ -13,7 +13,6 @@ package org.eclipse.core.internal.net.proxy.win32.winhttp; import java.net.URI; -import org.eclipse.core.internal.net.StringMatcher; import org.eclipse.core.internal.net.StringUtil; /** @@ -68,8 +67,7 @@ public class ProxyBypass { private boolean isInBypassList(String host) { for (int i = 0; i < proxyBypassEntries.length; i++) { String entry = proxyBypassEntries[i]; - StringMatcher matcher = new StringMatcher(entry, true, false); - if (matcher.match(host)) { + if (StringUtil.hostMatchesFilter(host, entry)) { return true; } } |