Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
*) httpd.mime: adding jar mimetype *) httpd.java: charset is only appended to mimetype for text mimetypes
thelic7ececbfb285
diff --git a/httpd.mime b/httpd.mimeindex 198a6fefb..d490262c0 100644--- a/httpd.mime+++ b/httpd.mime@@ -26,6 +26,7 @@ gz = application/gziphqx = application/mac-binhex40htm = text/htmlhtml = text/html+jar = application/java-archivejava = text/plainjpe = image/jpegjpeg = image/jpegdiff --git a/source/de/anomic/http/httpd.java b/source/de/anomic/http/httpd.javaindex 6f096fe31..cbe5abe4c 100644--- a/source/de/anomic/http/httpd.java+++ b/source/de/anomic/http/httpd.java@@ -1228,7 +1228,12 @@ public final class httpd implements serverHandler {if (httpVersion.toUpperCase().equals(httpHeader.HTTP_VERSION_1_1)) headers.put(httpHeader.CACHE_CONTROL, "no-cache");else headers.put(httpHeader.PRAGMA, "no-cache");}- headers.put(httpHeader.CONTENT_TYPE, (contentType == null)? "text/html; charset=UTF-8" : contentType+"; charset=UTF-8");++ if (contentType == null)+ contentType = "text/html; charset=UTF-8";+ else if (contentType.startsWith("text/") && contentType.toLowerCase().indexOf("charset=")==-1)+ contentType +="; charset=UTF-8";+ headers.put(httpHeader.CONTENT_TYPE, contentType);if (contentLength > 0) headers.put(httpHeader.CONTENT_LENGTH, Long.toString(contentLength));//if (cookie != null) headers.put(httpHeader.SET_COOKIE, cookie);if (expires != null) headers.put(httpHeader.EXPIRES, httpc.dateString(expires));