diff options
author | philippe-perrin-sonarsource <philippe.perrin@sonarsource.com> | 2019-09-20 12:19:30 +0200 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2019-09-23 20:21:07 +0200 |
commit | c8d43ec36a4a541406da2dbbaa74c6f033226dcd (patch) | |
tree | f4ec27d5529122c5e98f76d46edb33967c520704 /server/sonar-webserver | |
parent | a71460dc5e4e990538728100bdbaf8ad4220729d (diff) | |
download | sonarqube-c8d43ec36a4a541406da2dbbaa74c6f033226dcd.tar.gz sonarqube-c8d43ec36a4a541406da2dbbaa74c6f033226dcd.zip |
Remove reference to sonar-vsts from backend and fix test
Diffstat (limited to 'server/sonar-webserver')
4 files changed, 4 insertions, 7 deletions
diff --git a/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/SecurityServletFilter.java b/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/SecurityServletFilter.java index a8d1dd55cae..0ee688f2726 100644 --- a/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/SecurityServletFilter.java +++ b/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/SecurityServletFilter.java @@ -59,7 +59,7 @@ public class SecurityServletFilter implements Filter { // Clickjacking protection // See https://www.owasp.org/index.php/Clickjacking_Protection_for_Java_EE - // The protection is disabled on purpose for integration in external systems like VSTS (/integration/vsts/index.html). + // The protection is disabled on purpose for integration in external systems like Github (/integration/github). String path = httpRequest.getRequestURI().replaceFirst(httpRequest.getContextPath(), ""); if (!path.startsWith("/integration/")) { httpResponse.addHeader("X-Frame-Options", "SAMEORIGIN"); diff --git a/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/WebPagesCache.java b/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/WebPagesCache.java index ba4eedbc85d..8e672c64c7a 100644 --- a/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/WebPagesCache.java +++ b/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/WebPagesCache.java @@ -50,7 +50,7 @@ public class WebPagesCache { private static final String INDEX_HTML_PATH = "/index.html"; - private static final Set<String> HTML_PATHS = ImmutableSet.of(INDEX_HTML_PATH, "/integration/vsts/index.html"); + private static final Set<String> HTML_PATHS = ImmutableSet.of(INDEX_HTML_PATH); private final Platform platform; private final Configuration configuration; diff --git a/server/sonar-webserver/src/test/java/org/sonar/server/platform/web/SecurityServletFilterTest.java b/server/sonar-webserver/src/test/java/org/sonar/server/platform/web/SecurityServletFilterTest.java index e01eb8947ee..02018088271 100644 --- a/server/sonar-webserver/src/test/java/org/sonar/server/platform/web/SecurityServletFilterTest.java +++ b/server/sonar-webserver/src/test/java/org/sonar/server/platform/web/SecurityServletFilterTest.java @@ -94,7 +94,7 @@ public class SecurityServletFilterTest { @Test public void do_not_set_frame_protection_on_integration_resources() throws Exception { - HttpServletRequest request = newRequest("GET", "/integration/vsts/index.html"); + HttpServletRequest request = newRequest("GET", "/integration/github"); underTest.doFilter(request, response, chain); @@ -107,7 +107,7 @@ public class SecurityServletFilterTest { public void do_not_set_frame_protection_on_integration_resources_with_context() throws Exception { HttpServletRequest request = mock(HttpServletRequest.class); when(request.getMethod()).thenReturn("GET"); - when(request.getRequestURI()).thenReturn("/sonarqube/integration/vsts/index.html"); + when(request.getRequestURI()).thenReturn("/sonarqube/integration/github"); when(request.getContextPath()).thenReturn("/sonarqube"); underTest.doFilter(request, response, chain); diff --git a/server/sonar-webserver/src/test/java/org/sonar/server/platform/web/WebPagesCacheTest.java b/server/sonar-webserver/src/test/java/org/sonar/server/platform/web/WebPagesCacheTest.java index 6276f48d3a4..4e63c8f76db 100644 --- a/server/sonar-webserver/src/test/java/org/sonar/server/platform/web/WebPagesCacheTest.java +++ b/server/sonar-webserver/src/test/java/org/sonar/server/platform/web/WebPagesCacheTest.java @@ -60,8 +60,6 @@ public class WebPagesCacheTest { when(servletContext.getResourceAsStream("/index.html")).thenAnswer( (Answer<InputStream>) invocationOnMock -> toInputStream("Content of default index.html with context [%WEB_CONTEXT%], status [%SERVER_STATUS%], instance [%INSTANCE%]", UTF_8)); - when(servletContext.getResourceAsStream("/integration/vsts/index.html")) - .thenAnswer((Answer<InputStream>) invocationOnMock -> toInputStream("Content of vsts index.html with context [%WEB_CONTEXT%]", UTF_8)); } @Test @@ -73,7 +71,6 @@ public class WebPagesCacheTest { assertThat(underTest.getContent("/foo.html")).contains(TEST_CONTEXT).contains("default"); assertThat(underTest.getContent("/index")).contains(TEST_CONTEXT).contains("default"); assertThat(underTest.getContent("/index.html")).contains(TEST_CONTEXT).contains("default"); - assertThat(underTest.getContent("/integration/vsts/index.html")).contains(TEST_CONTEXT).contains("vsts"); } @Test |