From 6a166c204085783d00aaa4d42c32866d93c67d3e Mon Sep 17 00:00:00 2001 From: orbiter Date: Mon, 11 Oct 2010 11:38:36 +0000 Subject: [PATCH] patches for bad proxy behaviour - accept ipv6 localhost clients - index media files (url only) git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7238 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- defaults/yacy.init | 4 ++-- source/de/anomic/crawler/retrieval/Response.java | 6 +++++- source/de/anomic/http/server/HTTPDemon.java | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/defaults/yacy.init b/defaults/yacy.init index 9fbeddec3..0b9f4c685 100644 --- a/defaults/yacy.init +++ b/defaults/yacy.init @@ -332,7 +332,7 @@ remoteProxyPort=4239 remoteProxyUser= remoteProxyPwd= -remoteProxyNoProxy=10\..*,127.*,172.(1[6-9]|2[0-9]|3[0-1])\..*,169.254.*,192.168.*,localhost +remoteProxyNoProxy=10\..*,127.*,172.(1[6-9]|2[0-9]|3[0-1])\..*,169.254.*,192.168.*,localhost,0:0:0:0:0:0:0:1%0 # the proxy may filter the content of transferred web pages # the bluelist removes specific keywords from web pages @@ -351,7 +351,7 @@ proxyBlueList=yacy.blue # if several ip's are allowed then they must be separated by a ',' # any ip may contain the wildcard-sign '*' #proxyClient=192.168.0.4 -proxyClient=localhost,127.0.0.1,192.168.*,10\..* +proxyClient=localhost,127.0.0.1,192.168.*,10\..*,0:0:0:0:0:0:0:1%0 # YaCyHop: allow public usage of proxy for yacy-protocol # this enables usage of the internal http proxy for everyone, diff --git a/source/de/anomic/crawler/retrieval/Response.java b/source/de/anomic/crawler/retrieval/Response.java index fc05ee9e3..38ad4a892 100755 --- a/source/de/anomic/crawler/retrieval/Response.java +++ b/source/de/anomic/crawler/retrieval/Response.java @@ -538,10 +538,12 @@ public class Response { // we checked that in shallStoreCache // a picture cannot be indexed + /* if (Classification.isMediaExtension(url().getFileExtension())) { return "Media_Content_(forbidden)"; } - + */ + // -cookies in request // unfortunately, we cannot index pages which have been requested with a cookie // because the returned content may be special for the client @@ -557,9 +559,11 @@ public class Response { // a picture cannot be indexed final String mimeType = responseHeader.mime(); + /* if (Classification.isPictureMime(mimeType)) { return "Media_Content_(Picture)"; } + */ String parserError = TextParser.supportsMime(mimeType); if (parserError != null) { return "Media_Content, no parser: " + parserError; diff --git a/source/de/anomic/http/server/HTTPDemon.java b/source/de/anomic/http/server/HTTPDemon.java index 92168368b..237004f13 100644 --- a/source/de/anomic/http/server/HTTPDemon.java +++ b/source/de/anomic/http/server/HTTPDemon.java @@ -407,7 +407,7 @@ public final class HTTPDemon implements serverHandler, Cloneable { HTTPDFileHandler.doGet(prop, header, session.out); } else { // not authorized through firewall blocking (ip does not match filter) - session.out.write((httpVersion + " 403 refused (IP not granted)" + serverCore.CRLF_STRING + serverCore.CRLF_STRING + "you are not allowed to connect to this server, because you are using a non-granted IP. allowed are only connections that match with the following filter: " + switchboard.getConfig("serverClient", "*") + serverCore.CRLF_STRING).getBytes()); + session.out.write((httpVersion + " 403 refused (IP not granted, 1)" + serverCore.CRLF_STRING + serverCore.CRLF_STRING + "you are not allowed to connect to this server, because you are using a non-granted IP (" + session.userAddress.getHostAddress() + "). allowed are only connections that match with the following filter: " + switchboard.getConfig("serverClient", "*") + serverCore.CRLF_STRING).getBytes()); return serverCore.TERMINATE_CONNECTION; } } else { @@ -417,7 +417,7 @@ public final class HTTPDemon implements serverHandler, Cloneable { HTTPDProxyHandler.doGet(prop, header, session.out); } else { // not authorized through firewall blocking (ip does not match filter) - session.out.write((httpVersion + " 403 refused (IP not granted)" + serverCore.CRLF_STRING + serverCore.CRLF_STRING + "you are not allowed to connect to this proxy, because you are using a non-granted IP. allowed are only connections that match with the following filter: " + switchboard.getConfig("proxyClient", "*") + serverCore.CRLF_STRING).getBytes()); + session.out.write((httpVersion + " 403 refused (IP not granted, 2)" + serverCore.CRLF_STRING + serverCore.CRLF_STRING + "you are not allowed to connect to this proxy, because you are using a non-granted IP (" + session.userAddress.getHostAddress() + "). allowed are only connections that match with the following filter: " + switchboard.getConfig("proxyClient", "*") + serverCore.CRLF_STRING).getBytes()); return serverCore.TERMINATE_CONNECTION; } }