diff options
Diffstat (limited to 'language-web/src/main/java/org/eclipse/viatra')
-rw-r--r-- | language-web/src/main/java/org/eclipse/viatra/solver/language/web/CacheControlFilter.java | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/language-web/src/main/java/org/eclipse/viatra/solver/language/web/CacheControlFilter.java b/language-web/src/main/java/org/eclipse/viatra/solver/language/web/CacheControlFilter.java index 41b8e5bf..a1d086c4 100644 --- a/language-web/src/main/java/org/eclipse/viatra/solver/language/web/CacheControlFilter.java +++ b/language-web/src/main/java/org/eclipse/viatra/solver/language/web/CacheControlFilter.java | |||
@@ -34,9 +34,7 @@ public class CacheControlFilter implements Filter { | |||
34 | @Override | 34 | @Override |
35 | public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) | 35 | public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) |
36 | throws IOException, ServletException { | 36 | throws IOException, ServletException { |
37 | if (request instanceof HttpServletRequest && response instanceof HttpServletResponse) { | 37 | if (request instanceof HttpServletRequest httpRequest && response instanceof HttpServletResponse httpResponse) { |
38 | var httpRequest = (HttpServletRequest) request; | ||
39 | var httpResponse = (HttpServletResponse) response; | ||
40 | if (CACHE_URI_PATTERN.matcher(httpRequest.getRequestURI()).matches()) { | 38 | if (CACHE_URI_PATTERN.matcher(httpRequest.getRequestURI()).matches()) { |
41 | httpResponse.setHeader(CACHE_CONTROL_HEADER, CACHE_CONTROL_CACHE_VALUE); | 39 | httpResponse.setHeader(CACHE_CONTROL_HEADER, CACHE_CONTROL_CACHE_VALUE); |
42 | httpResponse.setDateHeader(EXPIRES_HEADER, System.currentTimeMillis() + EXPIRY * 1000L); | 40 | httpResponse.setDateHeader(EXPIRES_HEADER, System.currentTimeMillis() + EXPIRY * 1000L); |