]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7852 Remove routing of api/source without any action
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Fri, 3 Feb 2017 13:50:30 +0000 (14:50 +0100)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Mon, 6 Feb 2017 15:24:18 +0000 (16:24 +0100)
server/sonar-server/src/main/java/org/sonar/server/platform/web/RoutesFilter.java
server/sonar-server/src/test/java/org/sonar/server/platform/web/RoutesFilterTest.java

index 23a38770c02c80c26388d0ad294cee4d0323359f..2f9def38a921b4d1028c90761ca51e6fdd65eef6 100644 (file)
@@ -45,7 +45,6 @@ public class RoutesFilter implements Filter {
     new WebServiceListRoute(),
     new BatchRoute(),
     new BatchBootstrapRoute(),
-    new ApiSourcesRoute(),
     new ProfilesExportRoute());
 
   @Override
@@ -130,24 +129,6 @@ public class RoutesFilter implements Filter {
     }
   }
 
-  /**
-   * SONAR-7852 /api/sources?resource url is still used
-   */
-  private static class ApiSourcesRoute implements Route {
-
-    private static final String API_SOURCES_WS = "/api/sources";
-
-    @Override
-    public boolean test(String path) {
-      return API_SOURCES_WS.equals(path);
-    }
-
-    @Override
-    public String apply(HttpServletRequest request) {
-      return format("%s%s/index?%s", request.getContextPath(), API_SOURCES_WS, request.getQueryString());
-    }
-  }
-
   /**
    * Old scanners were using /profiles/export url (see SVS-130)
    */
index 1e8930a0feea49741c8ad387e891b2d2ce06604c..6d888f7c2ed1a4904f9bd9f82bf2656fdad098d5 100644 (file)
@@ -66,12 +66,6 @@ public class RoutesFilterTest {
     verifyRedirection("/batch_bootstrap/index/", null, "/sonarqube/batch/index");
   }
 
-  @Test
-  public void send_redirect_when_url_contains_api_sources() throws Exception {
-    verifyRedirection("/api/sources", "resource=my.project", "/sonarqube/api/sources/index?resource=my.project");
-    verifyRedirection("/api/sources/", "resource=my.project", "/sonarqube/api/sources/index?resource=my.project");
-  }
-
   @Test
   public void send_redirect_when_url_contains_profiles_export() throws Exception {
     verifyRedirection("/profiles/export", "format=pmd", "/sonarqube/api/qualityprofiles/export?format=pmd");