From: markt Date: Wed, 21 Jul 2010 16:37:58 +0000 (+0000) Subject: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49617 X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=cf8361ef8c7251b58a7f6231f27259e13e2c74a9;p=tomcat7.0 Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49617 Correct the ExpiresFilter documentation after changes to the submitted patch git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@966304 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/filters/ExpiresFilter.java b/java/org/apache/catalina/filters/ExpiresFilter.java index bf63918fd..39de57edb 100644 --- a/java/org/apache/catalina/filters/ExpiresFilter.java +++ b/java/org/apache/catalina/filters/ExpiresFilter.java @@ -110,43 +110,7 @@ import org.apache.juli.logging.LogFactory; * </web-app> * * - *

Configuration Parameters

- * ExpiresActive

- *

- * This directive enables or disables the generation of the Expires and - * Cache-Control headers by this ExpiresFilter. If set to - * Off, the headers will not be generated for any HTTP response. If set - * to On or true, the headers will be added to served HTTP - * responses according to the criteria defined by the - * ExpiresByType <content-type> and ExpiresDefault - * directives. Note that this directive does not guarantee that an - * Expires or Cache-Control header will be generated. If the - * criteria aren't met, no header will be sent, and the effect will be as - * though this directive wasn't even specified. - *

- *

- * This parameter is optional, default value is true. - *

- *

- * Enable filter - *

- * - *
- * <init-param>
- *    <!-- supports case insensitive 'On' or 'true' -->
- *    <param-name>ExpiresActive</param-name><param-value>On</param-value>
- * </init-param>
- * 
- *

- * Disable filter - *

- * - *
- * <init-param>
- *    <!-- supports anything different from case insensitive 'On' and 'true' -->
- *    <param-name>ExpiresActive</param-name><param-value>Off</param-value>
- * </init-param>
- * 
+ *

Configuration Parameters

* *

* ExpiresByType <content-type>

@@ -316,7 +280,7 @@ import org.apache.juli.logging.LogFactory; * max-age directive of the Cache-Control header), *
  • the response status code is not excluded by the directive * ExpiresExcludedResponseStatusCodes,
  • - *
  • The Content-Type of the response matches one of the types + *
  • the Content-Type of the response matches one of the types * defined the in ExpiresByType directives or the * ExpiresDefault directive is defined.
  • * @@ -412,7 +376,6 @@ import org.apache.juli.logging.LogFactory; *
      * Mar 26, 2010 2:01:41 PM org.apache.catalina.filters.ExpiresFilter init
      * FINE: Filter initialized with configuration ExpiresFilter[
    - *    active=true, 
      *    excludedResponseStatusCode=[304], 
      *    default=null, 
      *    byType={
    diff --git a/test/org/apache/catalina/filters/TestExpiresFilter.java b/test/org/apache/catalina/filters/TestExpiresFilter.java
    index 1e8daba97..17e398889 100644
    --- a/test/org/apache/catalina/filters/TestExpiresFilter.java
    +++ b/test/org/apache/catalina/filters/TestExpiresFilter.java
    @@ -59,7 +59,6 @@ public class TestExpiresFilter extends TomcatBaseTest {
                     "modification plus 5 hours 3 minutes");
             filterDef.addInitParameter("ExpiresByType image/jpg", "A10000");
             filterDef.addInitParameter("ExpiresByType video/mpeg", "M20000");
    -        filterDef.addInitParameter("ExpiresActive", "Off");
             filterDef.addInitParameter("ExpiresExcludedResponseStatusCodes",
                     "304, 503");
     
    diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
    index 71fa152b1..fdbaefea0 100644
    --- a/webapps/docs/changelog.xml
    +++ b/webapps/docs/changelog.xml
    @@ -66,8 +66,8 @@
             disabled by default. Based on a patch by Yair Lenga. (markt)
           
           
    -        48998: Add the ExpiresFilter, a port of the httpd mod_expires
    -        module. Patch provided by Cyrille Le Clerc. (markt)
    +        48998, 49617: Add the ExpiresFilter, a port of the
    +        httpd mod_expires module. Patch provided by Cyrille Le Clerc. (markt)
           
           
             49030: When initializing/starting/stopping connectors and
    diff --git a/webapps/docs/config/filter.xml b/webapps/docs/config/filter.xml
    index b00a2fc2e..5cc11d861 100644
    --- a/webapps/docs/config/filter.xml
    +++ b/webapps/docs/config/filter.xml
    @@ -319,7 +319,7 @@ The expiry time can be fine-tuned by adding several '
         max-age directive of the Cache-Control header),
         
  • the response status code is not excluded by the directive ExpiresExcludedResponseStatusCodes,
  • -
  • The Content-Type of the response matches one of the types +
  • the Content-Type of the response matches one of the types defined the in ExpiresByType directives or the ExpiresDefault directive is defined.
  • @@ -446,8 +446,7 @@ The expiry time can be fine-tuned by adding several ' </init-param>

    - Note that this directive only has effect if ExpiresActive On has - been specified. It overrides, for the specified MIME type only, any + It overrides, for the specified MIME type only, any expiration date set by the ExpiresDefault directive.

    @@ -483,13 +482,12 @@ The expiry time can be fine-tuned by adding several ' org.apache.catalina.filters.ExpiresFilter.level = FINE

    - Sample of initialization log message : + Sample of initialization log message:

    Mar 26, 2010 2:01:41 PM org.apache.catalina.filters.ExpiresFilter init FINE: Filter initialized with configuration ExpiresFilter[ - active=true, excludedResponseStatusCode=[304], default=null, byType={ @@ -499,7 +497,7 @@ FINE: Filter initialized with configuration ExpiresFilter[

    Sample of per-request log message where ExpiresFilter adds an - expiration date + expiration date:

    @@ -508,7 +506,7 @@ FINE: Request "/tomcat.gif" with response status "200" content-type "image/gif",

    Sample of per-request log message where ExpiresFilter does not add - an expiration date + an expiration date: