extended request for local peer check to by hostname resolved ip

the current islocal() check did not detect a domain.com address as request for the local peer.
pull/1/head
reger 11 years ago
parent c797f108a1
commit e6b9643fd6

@ -33,6 +33,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import net.yacy.cora.protocol.Domains;
import net.yacy.cora.util.ConcurrentLog;
import net.yacy.search.Switchboard;
@ -93,7 +94,14 @@ abstract public class AbstractRemoteHandler extends AbstractHandler implements H
localVirtualHostNames.add(sb.peers.myIP()); // not available on init, add it now for quickcheck
return;
}
InetAddress resolvedIP = Domains.dnsResolve(hostOnly); // during testing isLocal() failed to resolve domain against publicIP
if (sb.myPublicIP().equals(resolvedIP.getHostAddress())) {
localVirtualHostNames.add(resolvedIP.getHostName()); // remember resolved hostname
//localVirtualHostNames.add(resolved.getHostAddress());
return;
}
// from here we can assume it is a proxy request
// should check proxy use permission

Loading…
Cancel
Save