Naming: Add .i2p.alt support to naming services

This commit is contained in:
zzz
2024-01-30 08:02:51 -05:00
parent c6e6e7968c
commit 4b757105ec
3 changed files with 12 additions and 0 deletions

View File

@@ -55,6 +55,10 @@ public class DummyNamingService extends NamingService {
*/
@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;

View File

@@ -85,6 +85,10 @@ public class SingleFileNamingService extends NamingService {
*/
@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)