]> source.dussan.org Git - sonarqube.git/commitdiff
Remove reference to sonar-vsts from backend and fix test
authorphilippe-perrin-sonarsource <philippe.perrin@sonarsource.com>
Fri, 20 Sep 2019 10:19:30 +0000 (12:19 +0200)
committerSonarTech <sonartech@sonarsource.com>
Mon, 23 Sep 2019 18:21:07 +0000 (20:21 +0200)
server/sonar-webserver/src/main/java/org/sonar/server/platform/web/SecurityServletFilter.java
server/sonar-webserver/src/main/java/org/sonar/server/platform/web/WebPagesCache.java
server/sonar-webserver/src/test/java/org/sonar/server/platform/web/SecurityServletFilterTest.java
server/sonar-webserver/src/test/java/org/sonar/server/platform/web/WebPagesCacheTest.java

index a8d1dd55caec29b7f805cae53dd8e85b2c514cbb..0ee688f2726131401f238241d58cd95e76e32316 100644 (file)
@@ -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");
index ba4eedbc85dc56a67867a52f7a2d56a18bd98f69..8e672c64c7ad0f99db08515cf125ed527fc1eae2 100644 (file)
@@ -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;
index e01eb8947eeb1a023aa1c905791683ee2ccede18..0201808827146c70b8e3757a479a4a530fc29c46 100644 (file)
@@ -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);
index 6276f48d3a4631767d58c4e9d4124e773af6fb48..4e63c8f76db7511519acc10f77ebdbf9d5cf7e84 100644 (file)
@@ -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