* fix url proxy for relative links and chromium

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7805 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
f1ori 14 years ago
parent fdc84d8319
commit 96957375cc

@ -87,6 +87,7 @@ import java.util.zip.GZIPOutputStream;
import net.yacy.cora.date.GenericFormatter;
import net.yacy.cora.document.ASCII;
import net.yacy.cora.document.MultiProtocolURI;
import net.yacy.cora.document.UTF8;
import net.yacy.cora.protocol.Domains;
import net.yacy.cora.protocol.HeaderFramework;
@ -1410,7 +1411,8 @@ public final class HTTPDFileHandler {
} else {
// relative path of form href="relative/path"
m.appendReplacement(result, init + "/proxy.html?url=http://" + proxyurl.getHost() + directory + "/" + url);
MultiProtocolURI target = new MultiProtocolURI(proxyurl.getHost() + directory + "/" + url);
m.appendReplacement(result, init + "/proxy.html?url=" + target.toString());
}
}
@ -1421,14 +1423,17 @@ public final class HTTPDFileHandler {
if (outgoingHeader.containsKey(HeaderFramework.TRANSFER_ENCODING)) {
HTTPDemon.sendRespondHeader(conProp, out, httpVersion, httpStatus, outgoingHeader);
out = new ChunkedOutputStream(out);
ChunkedOutputStream cos = new ChunkedOutputStream(out);
cos.write(sbb);
cos.finish();
} else {
outgoingHeader.put(HeaderFramework.CONTENT_LENGTH, Integer.toString(sbb.length));
HTTPDemon.sendRespondHeader(conProp, out, httpVersion, httpStatus, outgoingHeader);
}
out.write(sbb);
}
} else {
if (!outgoingHeader.containsKey(HeaderFramework.CONTENT_LENGTH))
outgoingHeader.put(HeaderFramework.CONTENT_LENGTH, (String) prop.get(HeaderFramework.CONNECTION_PROP_PROXY_RESPOND_SIZE));

Loading…
Cancel
Save