From c3556bca6ffcc6556393d77fa773b2703e9ad99b Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Thu, 23 Jun 2011 18:10:18 +0200 Subject: [PATCH] =?utf8?q?CacheControlInterceptor=20pr=C3=BCft=20ETag=20je?= =?utf8?q?tzt=20auch,=20wenn=20If-Modified-Since=20fehlt?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../utils/cachecontrol/CacheControlInterceptor.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/utils/cachecontrol/src/main/java/de/halbekunst/utils/cachecontrol/CacheControlInterceptor.java b/utils/cachecontrol/src/main/java/de/halbekunst/utils/cachecontrol/CacheControlInterceptor.java index bc2dd3d8..088e775c 100644 --- a/utils/cachecontrol/src/main/java/de/halbekunst/utils/cachecontrol/CacheControlInterceptor.java +++ b/utils/cachecontrol/src/main/java/de/halbekunst/utils/cachecontrol/CacheControlInterceptor.java @@ -114,13 +114,12 @@ public class CacheControlInterceptor implements HandlerInterceptor { response.setStatus(HttpServletResponse.SC_NOT_MODIFIED); return false; } - else { - if (ifNoneMatch.equals(eTag)) { - log.debug("ETag {} not changed: 304 {}", ifNoneMatch, request.getRequestURI()); - response.setStatus(HttpServletResponse.SC_NOT_MODIFIED); - return false; - } - } + } + + if (ifNoneMatch != null && ifNoneMatch.equals(eTag)) { + log.debug("{}: ETag {} not changed -> 304 ", request.getRequestURI(), ifNoneMatch); + response.setStatus(HttpServletResponse.SC_NOT_MODIFIED); + return false; } /** HTTP/1.1-Caching-Header richtig setzen!! */ -- 2.20.1