*) httpd.mime: adding jar mimetype

*) httpd.java: charset is only appended to mimetype for text mimetypes

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1839 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
theli 19 years ago
parent 20ba05ad41
commit c7ececbfb2

@ -26,6 +26,7 @@ gz = application/gzip
hqx = application/mac-binhex40
htm = text/html
html = text/html
jar = application/java-archive
java = text/plain
jpe = image/jpeg
jpeg = image/jpeg

@ -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));

Loading…
Cancel
Save