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

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