diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2017-01-31 13:45:06 +0100 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2017-02-01 14:13:02 +0100 |
commit | c4f02002749a0d0713665e38b7391d86e7ed66a2 (patch) | |
tree | 7bd875bdb2622601fe02547c20d709651a187041 /sonar-plugin-api | |
parent | e56922d4784ad131771dea70eb32a9263d58013a (diff) | |
download | sonarqube-c4f02002749a0d0713665e38b7391d86e7ed66a2.tar.gz sonarqube-c4f02002749a0d0713665e38b7391d86e7ed66a2.zip |
SONAR-8470 Allow rendering some static files from root
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/web/ServletFilter.java | 3 | ||||
-rw-r--r-- | sonar-plugin-api/src/test/java/org/sonar/api/web/ServletFilterTest.java | 9 |
2 files changed, 8 insertions, 4 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/ServletFilter.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/ServletFilter.java index e9b37aaa110..7d8cbb5c46e 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/web/ServletFilter.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/web/ServletFilter.java @@ -121,7 +121,8 @@ public abstract class ServletFilter implements Filter { */ public static class Builder { private static final String WILDCARD_CHAR = "*"; - private static final Collection<String> STATIC_RESOURCES = ImmutableList.of("/css/*", "/fonts/*", "/images/*", "/js/*", "/static/*"); + private static final Collection<String> STATIC_RESOURCES = ImmutableList.of("/css/*", "/fonts/*", "/images/*", "/js/*", "/static/*", + "/robots.txt", "/favicon.ico", "/apple-touch-icon*"); private final Set<String> inclusions = new LinkedHashSet<>(); private final Set<String> exclusions = new LinkedHashSet<>(); diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/web/ServletFilterTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/web/ServletFilterTest.java index af208b6c933..72c2ba21e52 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/web/ServletFilterTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/web/ServletFilterTest.java @@ -19,8 +19,6 @@ */ package org.sonar.api.web; -import static org.assertj.core.api.Assertions.assertThat; - import java.io.IOException; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; @@ -31,6 +29,8 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; +import static org.assertj.core.api.Assertions.assertThat; + public class ServletFilterTest { @Rule public ExpectedException thrown = ExpectedException.none(); @@ -221,7 +221,10 @@ public class ServletFilterTest { "/fonts/*", "/images/*", "/js/*", - "/static/*"); + "/static/*", + "/robots.txt", + "/favicon.ico", + "/apple-touch-icon*"); } private static class FakeFilter extends ServletFilter { |