Ticket #13089: 0001-set-compression-filter-in-web-app.patch

File 0001-set-compression-filter-in-web-app.patch, 2.2 KB (added by iwakeh, 5 years ago)

web-app compression config based on task-13089-4

  • build.xml

    From c364acce158967cca8dfe171d102166e13b7da27 Sun Nov 16 22:00:00 2014
    From: iwakeh <iwakeh@users.ourproject.org>
    Date: Sun, 16 Nov 2014 22:00:00 +0000
    Subject: [PATCH] set compression filter in web-app.
    
    ---
     build.xml            |  2 ++
     etc/web.xml.template | 24 ++++++++++++++++++++++++
     2 files changed, 26 insertions(+)
    
    diff --git a/build.xml b/build.xml
    index 0ecea38..0bea931 100644
    a b  
    3434      <include name="logback-core-1.0.4.jar"/>
    3535      <include name="slf4j-api-1.6.5.jar"/>
    3636      <include name="jetty8-server-8.1.3.v20120416.jar"/>
     37      <include name="jetty8-servlets-8.1.3.v20120416.jar"/>
    3738      <include name="jetty8-servlet-8.1.3.v20120416.jar"/>
    3839      <include name="jetty8-util-8.1.3.v20120416.jar"/>
    3940      <include name="jetty8-http-8.1.3.v20120416.jar"/>
     
    122123        <include name="servlet-api-3.0.jar"/>
    123124        <include name="jetty8-server-8.1.3.v20120416.jar"/>
    124125        <include name="jetty8-servlet-8.1.3.v20120416.jar"/>
     126        <include name="jetty8-servlets-8.1.3.v20120416.jar"/>
    125127        <include name="jetty8-util-8.1.3.v20120416.jar"/>
    126128        <include name="jetty8-http-8.1.3.v20120416.jar"/>
    127129        <include name="jetty8-io-8.1.3.v20120416.jar"/>
  • etc/web.xml.template

    diff --git a/etc/web.xml.template b/etc/web.xml.template
    index 2c0b280..1c30bc6 100644
    a b  
    5151      org.torproject.onionoo.server.NodeIndexer
    5252    </listener-class>
    5353  </listener>
     54
     55
     56  <filter>
     57    <filter-name>GzipFilter</filter-name>
     58    <filter-class>org.eclipse.jetty.servlets.GzipFilter</filter-class>
     59    <init-param>
     60      <param-name>mimeTypes</param-name>
     61      <param-value>text/html,text/xml,text/plain,application/json</param-value>
     62    </init-param>
     63    <init-param>
     64      <param-name>excludedAgents</param-name>
     65      <param-value>gozilla,traviata</param-value>
     66    </init-param>
     67    <init-param>
     68      <param-name>minGzipSize</param-name>
     69      <param-value>2048</param-value>
     70    </init-param>
     71  </filter>
     72
     73  <filter-mapping>
     74    <filter-name>GzipFilter</filter-name>
     75    <url-pattern>/*</url-pattern>
     76  </filter-mapping>
     77
    5478</web-app>
    5579