Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
no no-cache for mediaExts see http://www.yacy-forum.de/viewtopic.php?p=11210#11210
allo0f2f783e46d7
diff --git a/source/de/anomic/http/httpdFileHandler.java b/source/de/anomic/http/httpdFileHandler.javaindex 0c4f54f19..f05e690b8 100644--- a/source/de/anomic/http/httpdFileHandler.java+++ b/source/de/anomic/http/httpdFileHandler.java@@ -100,6 +100,7 @@ import java.awt.image.BufferedImage;import javax.imageio.ImageIO;import de.anomic.plasma.plasmaSwitchboard;+import de.anomic.plasma.plasmaParser;import de.anomic.server.serverByteBuffer;import de.anomic.server.serverClassLoader;import de.anomic.server.serverCodings;@@ -253,11 +254,20 @@ public final class httpdFileHandler extends httpdAbstractHandler implements http// out.flush();// }- private httpHeader getDefaultHeaders() {+ private httpHeader getDefaultHeaders(String path) {httpHeader headers = new httpHeader();+ String ext;+ int pos;+ if ((pos = path.lastIndexOf('.')) < 0) {+ ext = "";+ } else {+ ext = path.substring(pos + 1).toLowerCase();+ }headers.put(httpHeader.SERVER, "AnomicHTTPD (www.anomic.de)");headers.put(httpHeader.DATE, httpc.dateString(httpc.nowDate()));- headers.put(httpHeader.PRAGMA, "no-cache");+ if(!(plasmaParser.mediaExtContains(ext))){+ headers.put(httpHeader.PRAGMA, "no-cache");+ }return headers;}@@ -297,7 +307,7 @@ public final class httpdFileHandler extends httpdAbstractHandler implements http// authentication requiredif (authorization == null) {// no authorization given in response. Ask for that- httpHeader headers = getDefaultHeaders();+ httpHeader headers = getDefaultHeaders(path);headers.put(httpHeader.WWW_AUTHENTICATE,"Basic realm=\"admin log-in\"");httpd.sendRespondHeader(conProp,out,httpVersion,401,headers);return;@@ -314,7 +324,7 @@ public final class httpdFileHandler extends httpdAbstractHandler implements httpelseserverCore.bfHost.put(clientIP, new Integer(attempts.intValue() + 1));- httpHeader headers = getDefaultHeaders();+ httpHeader headers = getDefaultHeaders(path);headers.put(httpHeader.WWW_AUTHENTICATE,"Basic realm=\"admin log-in\"");httpd.sendRespondHeader(conProp,out,httpVersion,401,headers);return;@@ -505,7 +515,7 @@ public final class httpdFileHandler extends httpdAbstractHandler implements httpserverCore.bfHost.put(clientIP, new Integer(attempts.intValue() + 1));}// send authentication request to browser- httpHeader headers = getDefaultHeaders();+ httpHeader headers = getDefaultHeaders(path);headers.put(httpHeader.WWW_AUTHENTICATE,"Basic realm=\"" + tp.get("AUTHENTICATE", "") + "\"");httpd.sendRespondHeader(conProp,out,httpVersion,401,headers);return;@@ -513,7 +523,7 @@ public final class httpdFileHandler extends httpdAbstractHandler implements httpString location = tp.get("LOCATION","");if (location.length() == 0) location = path;- httpHeader headers = getDefaultHeaders();+ httpHeader headers = getDefaultHeaders(path);headers.put(httpHeader.LOCATION,location);httpd.sendRespondHeader(conProp,out,httpVersion,302,headers);return;