-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace URL with String as the key (#1038)
The equals() implementation of URL resolves the hostname into an IP address. When multiple URLs are mapped into the same IP (especially with 1.1.1.1 DNS server), it will cause the following exception: ``` java.lang.IllegalArgumentException: Multiple entries with same key: https://ifconfig.co/ip=Success(x.x.x.x) and https://www.trackip.net/ip=Success(x.x.x.x) at com.google.common.collect.ImmutableMap.conflictException(ImmutableMap.java:377) at com.google.common.collect.ImmutableMap.checkNoConflict(ImmutableMap.java:371) at com.google.common.collect.RegularImmutableMap.checkNoConflictInKeyBucket(RegularImmutableMap.java:241) at com.google.common.collect.RegularImmutableMap.fromEntryArrayCheckingBucketOverflow(RegularImmutableMap.java:132) at com.google.common.collect.RegularImmutableMap.fromEntryArray(RegularImmutableMap.java:94) at com.google.common.collect.ImmutableMap$Builder.build(ImmutableMap.java:573) at com.google.common.collect.ImmutableMap$Builder.buildOrThrow(ImmutableMap.java:601) at com.google.common.collect.ImmutableMap$Builder.build(ImmutableMap.java:588) at com.radixdlt.p2p.hostip.NetworkQueryHostIp.get(NetworkQueryHostIp.java:191) ```
- Loading branch information
Showing
2 changed files
with
50 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters