Es werden nun vorerst doch auch 30x-Antworten werden dekoriert
[percentcodec] / cachecontrol / src / main / java / de / halbekunst / juplo / cachecontrol / CacheControl.java
index bf49a45..458979d 100644 (file)
@@ -72,6 +72,15 @@ public class CacheControl {
       case HttpServletResponse.SC_PARTIAL_CONTENT: // 206
         /** Normale Antwort! Antwort dekorieren... */
         break;
+      case HttpServletResponse.SC_MOVED_PERMANENTLY: // 301
+      case HttpServletResponse.SC_MOVED_TEMPORARILY: // 302
+      case HttpServletResponse.SC_SEE_OTHER: // 303
+      case HttpServletResponse.SC_NOT_MODIFIED: // 304
+      case HttpServletResponse.SC_USE_PROXY: // 305
+      case HttpServletResponse.SC_TEMPORARY_REDIRECT: // 307
+        /** Redirect-Antwort! Antwort dekodieren... */
+        // TODO: Kann das wirklich nicht zu Protokoll-Verletzungen führen?
+        break;
       case HttpServletResponse.SC_BAD_REQUEST: // 400
       case HttpServletResponse.SC_UNAUTHORIZED: // 401
       case HttpServletResponse.SC_PAYMENT_REQUIRED: // 402
@@ -120,7 +129,7 @@ public class CacheControl {
     }
 
     int cacheSeconds = handle.getCacheSeconds(request);
-    if (cacheSeconds < 1) {
+    if (cacheSeconds < 0) {
       log.debug("{}: caching disabled!", url);
       response.setDateHeader(Headers.HEADER_DATE, handle.getTimestamp());
       response.setDateHeader(Headers.HEADER_EXPIRES, 0);
@@ -328,7 +337,6 @@ public class CacheControl {
 
       cacheSeconds = CacheControl.this.defaultCacheSeconds;
       lastModified = CacheControl.this.defaultLastModified;
-      eTag = "";
 
       /** Class-Level-Annotations auslesen */
       for (Annotation annotation : handler.getClass().getAnnotations()) {