diff --git a/apps/addressbook/java/src/net/i2p/router/naming/BlockfileNamingService.java b/apps/addressbook/java/src/net/i2p/router/naming/BlockfileNamingService.java index ca11d16590..d72a23a8b2 100644 --- a/apps/addressbook/java/src/net/i2p/router/naming/BlockfileNamingService.java +++ b/apps/addressbook/java/src/net/i2p/router/naming/BlockfileNamingService.java @@ -762,6 +762,10 @@ private static Integer getReverseKey(Hash hash) { */ @Override public Destination lookup(String hostname, Properties lookupOptions, Properties storedOptions) { + if (hostname.endsWith(".i2p.alt")) { + // RFC 9476 + hostname = hostname.substring(0, hostname.length() - 4); + } Destination rv = lookup2(hostname, lookupOptions, storedOptions); if (rv == null) { // if hostname starts with "www.", strip and try again diff --git a/core/java/src/net/i2p/client/naming/DummyNamingService.java b/core/java/src/net/i2p/client/naming/DummyNamingService.java index 89a73540c0..a39ad112b0 100644 --- a/core/java/src/net/i2p/client/naming/DummyNamingService.java +++ b/core/java/src/net/i2p/client/naming/DummyNamingService.java @@ -55,6 +55,10 @@ protected DummyNamingService(I2PAppContext context) { */ @Override public Destination lookup(String hostname, Properties lookupOptions, Properties storedOptions) { + if (hostname.endsWith(".i2p.alt")) { + // RFC 9476 + hostname = hostname.substring(0, hostname.length() - 4); + } Destination d = getCache(hostname); if (d != null) return d; diff --git a/core/java/src/net/i2p/client/naming/SingleFileNamingService.java b/core/java/src/net/i2p/client/naming/SingleFileNamingService.java index dfe4d270f3..dca47c157b 100644 --- a/core/java/src/net/i2p/client/naming/SingleFileNamingService.java +++ b/core/java/src/net/i2p/client/naming/SingleFileNamingService.java @@ -85,6 +85,10 @@ public String getName() { */ @Override public Destination lookup(String hostname, Properties lookupOptions, Properties storedOptions) { + if (hostname.endsWith(".i2p.alt")) { + // RFC 9476 + hostname = hostname.substring(0, hostname.length() - 4); + } try { String key = getKey(hostname); if (key == null && hostname.startsWith("www.") && hostname.length() > 7)