From: Kai Moritz Date: Thu, 23 Jun 2011 16:10:18 +0000 (+0200) Subject: CacheControlInterceptor prüft ETag jetzt auch, wenn If-Modified-Since fehlt X-Git-Tag: 1.0~4 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=c3556bca6ffcc6556393d77fa773b2703e9ad99b;p=percentcodec CacheControlInterceptor prüft ETag jetzt auch, wenn If-Modified-Since fehlt --- 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!! */