Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

URLproxy access check too tight respect config ip pattern (was own ip)

regerc589ee8c6e5e
diff --git a/source/net/yacy/http/servlets/YaCyProxyServlet.java b/source/net/yacy/http/servlets/YaCyProxyServlet.java
index fa710e164..b125a6c85 100644
--- a/source/net/yacy/http/servlets/YaCyProxyServlet.java
+++ b/source/net/yacy/http/servlets/YaCyProxyServlet.java
@@ -83,13 +83,11 @@ public class YaCyProxyServlet extends ProxyServlet implements Servlet {
final String remoteHost = req.getRemoteHost();
if (!Domains.isThisHostIP(remoteHost)) {
- response.sendError(HttpServletResponse.SC_FORBIDDEN,
- "proxy use not granted for IP " + remoteHost);
- return;
- } else if (!proxyippatternmatch(remoteHost)) {
- response.sendError(HttpServletResponse.SC_FORBIDDEN,
- "proxy use not granted for IP " + remoteHost);
- return;
+ if (!proxyippatternmatch(remoteHost)) {
+ response.sendError(HttpServletResponse.SC_FORBIDDEN,
+ "proxy use not granted for IP " + remoteHost);
+ return;
+ }
}
if ("CONNECT".equalsIgnoreCase(request.getMethod())) {