diff options
author | Peter Hermsdorf | 2020-10-26 09:50:21 +0000 |
---|---|---|
committer | Peter Hermsdorf | 2020-10-26 09:50:21 +0000 |
commit | 67f29b0a591b01af5939d12b5a4e5c49259e2b70 (patch) | |
tree | 7ee07ec71cbb141fb910b785d8db61eff054e7ce | |
parent | de805f046225fc5a900b3ae13055d2c41f2df071 (diff) | |
download | org.eclipse.ecf-67f29b0a591b01af5939d12b5a4e5c49259e2b70.tar.gz org.eclipse.ecf-67f29b0a591b01af5939d12b5a4e5c49259e2b70.tar.xz org.eclipse.ecf-67f29b0a591b01af5939d12b5a4e5c49259e2b70.zip |
Bug 568174 using invalid host name produces misleading error
force validation of URI by calling parseServerAuthority
Change-Id: I7008e273ded75ca915f9233a022954fdfc737db9
-rw-r--r-- | framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/TCPServerSOContainer.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/TCPServerSOContainer.java b/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/TCPServerSOContainer.java index 2efddbc39..c5a39c2dd 100644 --- a/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/TCPServerSOContainer.java +++ b/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/TCPServerSOContainer.java @@ -97,7 +97,7 @@ public class TCPServerSOContainer extends ServerSOContainer implements IConnectR public TCPServerSOContainer(ISharedObjectContainerConfig config, InetAddress bindAddress, int keepAlive) throws IOException, URISyntaxException { super(config); isSingle = true; - URI actualURI = new URI(getID().getName()); + URI actualURI = parseAndValidateURI(); int port = actualURI.getPort(); String path = actualURI.getPath(); if (path == null) @@ -111,7 +111,7 @@ public class TCPServerSOContainer extends ServerSOContainer implements IConnectR super(config); this.keepAlive = keepAlive; // Make sure URI syntax is followed. - URI actualURI = new URI(getID().getName()); + URI actualURI = parseAndValidateURI(); int urlPort = actualURI.getPort(); String path = actualURI.getPath(); if (grp == null) { @@ -124,6 +124,12 @@ public class TCPServerSOContainer extends ServerSOContainer implements IConnectR this.group.putOnTheAir(); } + private URI parseAndValidateURI() throws URISyntaxException { + URI uri = new URI(getID().getName()); + uri.parseServerAuthority(); + return uri; + } + public TCPServerSOContainer(ISharedObjectContainerConfig config, TCPServerSOContainerGroup listener, String path, int keepAlive) { super(config); initialize(listener, path, keepAlive); |