Console: Fix gzip enable logic

Don't compress js
Set charset for war resources
This commit is contained in:
zzz
2018-03-10 14:53:57 +00:00
parent fa85c0c50b
commit fe808a8800
3 changed files with 25 additions and 5 deletions

View File

@ -377,8 +377,16 @@ class BasicServlet extends HttpServlet
protected void writeHeaders(HttpServletResponse response,HttpContent content,long count)
throws IOException
{
if (content.getContentType()!=null && response.getContentType()==null)
response.setContentType(content.getContentType());
String rtype = response.getContentType();
String ctype = content.getContentType();
if (rtype != null) {
if (rtype.equals("application/javascript"))
response.setCharacterEncoding("ISO-8859-1");
} else if (ctype != null) {
response.setContentType(ctype);
if (ctype.equals("application/javascript"))
response.setCharacterEncoding("ISO-8859-1");
}
response.setHeader("X-Content-Type-Options", "nosniff");
long lml = content.getLastModified();
if (lml > 0)