Skip to content

Commit

Permalink
Don't return identity hash links
Browse files Browse the repository at this point in the history
  • Loading branch information
ianopolous committed Apr 12, 2024
1 parent 4a43315 commit de9479b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/org/peergos/net/APIHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,11 @@ public void handleCallToAPI(HttpExchange httpExchange) {
List<List<String>> links = blocks.stream()
.map(b -> b.hash.codec.equals(Cid.Codec.Raw) ?
Collections.<String>emptyList() :
CborObject.getLinks(b.hash, b.block).stream().map(Cid::toString).collect(Collectors.toList()))
CborObject.getLinks(b.hash, b.block)
.stream()
.filter(c -> c.getType() != Multihash.Type.id)
.map(Cid::toString)
.collect(Collectors.toList()))
.collect(Collectors.toList());
replyJson(httpExchange, JSONParser.toString(links));
} else {
Expand Down

0 comments on commit de9479b

Please sign in to comment.