mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2026-08-10 00:27:00 +00:00
strip path from server url when determining host and port
This commit is contained in:
@@ -129,7 +129,9 @@ public enum Protocol {
|
||||
public abstract CloseableTransport getTransport(HostAndPort server, File serverCert, HostAndPort proxy) throws IOException, CertificateException, NoSuchAlgorithmException, KeyStoreException, KeyManagementException;
|
||||
|
||||
public HostAndPort getServerHostAndPort(String url) {
|
||||
return HostAndPort.fromString(url.substring(this.toUrlString().length()));
|
||||
String lessProtocol = url.substring(this.toUrlString().length());
|
||||
int pathStart = lessProtocol.indexOf('/');
|
||||
return HostAndPort.fromString(pathStart < 0 ? lessProtocol : lessProtocol.substring(0, pathStart));
|
||||
}
|
||||
|
||||
public String toUrlString() {
|
||||
|
||||
Reference in New Issue
Block a user