forked from I2P_Developers/i2p.i2p
Naming: Add .i2p.alt support to naming services
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user