improve character encoding for urlproxy servlet

for none utf-8 pages
pull/159/head
reger 10 years ago
parent b161473cd0
commit 572cfe8fd4

@ -258,8 +258,14 @@ public class UrlProxyServlet extends ProxyServlet implements Servlet {
}
// 9 - deliver to client
byte[] sbb = UTF8.getBytes(doc.toString());
byte[] sbb;
if (doc.charset() == null) {
sbb = UTF8.getBytes(doc.toString());
response.setCharacterEncoding(UTF8.charset.name());
} else { // keep orig charset
sbb = doc.toString().getBytes(doc.charset());
response.setCharacterEncoding(doc.charset().name());
}
// add some proxy-headers to response header
if (proxyResponseHeader.containsKey(HeaderFramework.SERVER)) {
response.setHeader(HeaderFramework.SERVER, proxyResponseHeader.get(HeaderFramework.SERVER));

Loading…
Cancel
Save