Changeset fe808a8


Ignore:
Timestamp:
Mar 10, 2018 2:53:57 PM (2 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
e7c2162
Parents:
fa85c0c
Message:

Console: Fix gzip enable logic
Don't compress js
Set charset for war resources

Location:
apps
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • apps/i2psnark/java/src/org/klomp/snark/web/BasicServlet.java

    rfa85c0c rfe808a8  
    378378        throws IOException
    379379    {   
    380         if (content.getContentType()!=null && response.getContentType()==null)
    381             response.setContentType(content.getContentType());
     380        String rtype = response.getContentType();
     381        String ctype = content.getContentType();
     382        if (rtype != null) {
     383            if (rtype.equals("application/javascript"))
     384                response.setCharacterEncoding("ISO-8859-1");
     385        } else if (ctype != null) {
     386            response.setContentType(ctype);
     387            if (ctype.equals("application/javascript"))
     388                response.setCharacterEncoding("ISO-8859-1");
     389        }
    382390        response.setHeader("X-Content-Type-Options", "nosniff");
    383391        long lml = content.getLastModified();
  • apps/routerconsole/java/src/net/i2p/router/web/HostCheckHandler.java

    rfa85c0c rfe808a8  
    4444        _listenHosts = new HashSet<String>(8);
    4545        setMinGzipSize(64*1024);
    46         if (!_context.getBooleanPropertyDefaultTrue(PROP_GZIP)) {
    47             addIncludedMimeTypes("application/x-javascript", "application/xhtml+xml", "application/xml",
    48                                  "image/svg+xml", "text/css", "text/html", "text/plain");
     46        if (_context.getBooleanPropertyDefaultTrue(PROP_GZIP)) {
     47            addIncludedMimeTypes(
     48                                 // our js is very small
     49                                 //"application/javascript", "application/x-javascript",
     50                                 "application/xhtml+xml", "application/xml",
     51                                 "image/svg+xml", "text/css", "text/html", "text/plain"
     52                                );
     53        } else {
     54            // poorly documented, but we must put something in,
     55            // if empty all are matched,
     56            // see IncludeExcludeSet
     57            addIncludedMimeTypes("xyzzy");
    4958        }
    5059    }
  • apps/routerconsole/java/src/net/i2p/router/web/LocaleWebAppHandler.java

    rfa85c0c rfe808a8  
    9797                }
    9898            }
     99        } else if (pathInContext.startsWith("/js/")) {
     100            // war internal
     101            httpResponse.setCharacterEncoding("ISO-8859-1");
    99102        }
    100103        //System.err.println("New path: " + newPath);
Note: See TracChangeset for help on using the changeset viewer.