diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2018-06-08 13:28:58 +0200 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2018-06-08 20:20:52 +0200 |
commit | 3c04430ca109e171b5981940b9348635837ec18d (patch) | |
tree | 88e2b9473eb65290332633c1d0803941120e9962 | |
parent | e6d7fdb0d12d1ebe9212a941b71736c20969c434 (diff) | |
download | sonarqube-3c04430ca109e171b5981940b9348635837ec18d.tar.gz sonarqube-3c04430ca109e171b5981940b9348635837ec18d.zip |
SONAR-10674 Fix max ages caches for plugins static resources
Max ages cache was wrongly set to 5 hours instead of 5 minutes
3 files changed, 5 insertions, 5 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/platform/web/CacheControlFilter.java b/server/sonar-server/src/main/java/org/sonar/server/platform/web/CacheControlFilter.java index b8a238f5653..e0034435047 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/platform/web/CacheControlFilter.java +++ b/server/sonar-server/src/main/java/org/sonar/server/platform/web/CacheControlFilter.java @@ -46,7 +46,7 @@ public class CacheControlFilter implements Filter { */ private static final int ONE_YEAR_IN_SECONDS = 365 * 24 * 60 * 60; - private static final int FIVE_MINUTES_IN_SECONDS = 5 * 60 * 60; + private static final int FIVE_MINUTES_IN_SECONDS = 5 * 60; private static final String MAX_AGE_TEMPLATE = "max-age=%d"; diff --git a/server/sonar-server/src/test/java/org/sonar/server/platform/web/CacheControlFilterTest.java b/server/sonar-server/src/test/java/org/sonar/server/platform/web/CacheControlFilterTest.java index 5f967c642c7..b5bf1746cd0 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/platform/web/CacheControlFilterTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/platform/web/CacheControlFilterTest.java @@ -62,7 +62,7 @@ public class CacheControlFilterTest { underTest.doFilter(request, response, chain); - verify(response).addHeader("Cache-Control", format("max-age=%s", 18_000)); + verify(response).addHeader("Cache-Control", format("max-age=%s", 300)); } @Test @@ -71,7 +71,7 @@ public class CacheControlFilterTest { underTest.doFilter(request, response, chain); - verify(response).addHeader("Cache-Control", format("max-age=%s", 18_000)); + verify(response).addHeader("Cache-Control", format("max-age=%s", 300)); } @Test @@ -80,7 +80,7 @@ public class CacheControlFilterTest { underTest.doFilter(request, response, chain); - verify(response).addHeader("Cache-Control", format("max-age=%s", 18_000)); + verify(response).addHeader("Cache-Control", format("max-age=%s", 300)); } @Test diff --git a/tests/src/test/java/org/sonarqube/tests/serverSystem/HttpHeadersTest.java b/tests/src/test/java/org/sonarqube/tests/serverSystem/HttpHeadersTest.java index c4f3fe36382..cdf54736541 100644 --- a/tests/src/test/java/org/sonarqube/tests/serverSystem/HttpHeadersTest.java +++ b/tests/src/test/java/org/sonarqube/tests/serverSystem/HttpHeadersTest.java @@ -37,7 +37,7 @@ import static util.ItUtils.call; public class HttpHeadersTest { private static final int ONE_YEAR_IN_SECONDS = 365 * 24 * 60 * 60; - private static final int FIVE_MINUTES_IN_SECONDS = 5 * 60 * 60; + private static final int FIVE_MINUTES_IN_SECONDS = 5 * 60; @ClassRule public static final Orchestrator orchestrator = Category4Suite.ORCHESTRATOR; |