From bd0318ba81005f5c530bb300778acf440fd71ba1 Mon Sep 17 00:00:00 2001 From: f1ori Date: Tue, 9 Sep 2008 14:04:52 +0000 Subject: [PATCH] * YaCy only supports gzip-encoding, so remove any other encoding from request * fixes http://www.yacy-forum.org/viewtopic.php?f=2&t=163 git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5132 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/http/httpdProxyHandler.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/de/anomic/http/httpdProxyHandler.java b/source/de/anomic/http/httpdProxyHandler.java index fa9526d2b..2ddccbb72 100644 --- a/source/de/anomic/http/httpdProxyHandler.java +++ b/source/de/anomic/http/httpdProxyHandler.java @@ -1183,6 +1183,13 @@ public final class httpdProxyHandler { // change the User-Agent requestHeader.put(httpHeader.USER_AGENT, generateUserAgent(requestHeader)); } + + // only gzip-encoding is supported, remove other encodings (e. g. deflate) + if (((String)requestHeader.get(httpRequestHeader.ACCEPT_ENCODING,"")).indexOf("gzip") != -1) { + requestHeader.put(httpRequestHeader.ACCEPT_ENCODING, "gzip"); + } else { + requestHeader.put(httpRequestHeader.ACCEPT_ENCODING, ""); + } addXForwardedForHeader(conProp, requestHeader); }