Skip to content

Commit 9b4e09f

Browse files
author
gjeanmart
committed
reverted last commit
1 parent 2004ef5 commit 9b4e09f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/io/ipfs/api/IPFS.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public IPFS(String multiaddr) {
5050
}
5151

5252
public IPFS(MultiAddress addr) {
53-
this(addr.getHost(), addr.getTCPPort(), "/api/v0/", addr.isHTTPOverSSL());
53+
this(addr.getHost(), addr.getTCPPort(), "/api/v0/", detectSSL(addr));
5454
}
5555

5656
public IPFS(String host, int port, String version, boolean ssl) {
@@ -724,4 +724,8 @@ private static final byte[] readFully(InputStream in) throws IOException {
724724
resp.write(buf, 0, r);
725725
return resp.toByteArray();
726726
}
727+
728+
private static boolean detectSSL(MultiAddress multiaddress) {
729+
return multiaddress.toString().contains("/https");
730+
}
727731
}

0 commit comments

Comments
 (0)