diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/UrlModule.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/UrlModule.java index a712f9b9c8..9e69946678 100644 --- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/UrlModule.java +++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/UrlModule.java @@ -26,7 +26,6 @@ import com.google.gerrit.httpd.raw.ToolServlet; import com.google.gerrit.httpd.rpc.account.AccountCapabilitiesServlet; import com.google.gerrit.httpd.rpc.change.DeprecatedChangeQueryServlet; import com.google.gerrit.httpd.rpc.change.ListChangesServlet; -import com.google.gerrit.httpd.rpc.plugin.ListPluginsServlet; import com.google.gerrit.httpd.rpc.project.ListProjectsServlet; import com.google.gerrit.reviewdb.client.Change; import com.google.gerrit.reviewdb.client.Project; @@ -96,7 +95,6 @@ class UrlModule extends ServletModule { filter("/a/*").through(RequireIdentifiedUserFilter.class); serveRegex("^/(?:a/)?accounts/self/capabilities$").with(AccountCapabilitiesServlet.class); serveRegex("^/(?:a/)?changes/$").with(ListChangesServlet.class); - serveRegex("^/(?:a/)?plugins/$").with(ListPluginsServlet.class); serveRegex("^/(?:a/)?projects/(.*)?$").with(ListProjectsServlet.class); if (cfg.deprecatedQuery) { diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/plugins/HttpPluginServlet.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/plugins/HttpPluginServlet.java index 47eae99711..e737700088 100644 --- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/plugins/HttpPluginServlet.java +++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/plugins/HttpPluginServlet.java @@ -19,6 +19,7 @@ import com.google.common.cache.Cache; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.gerrit.extensions.registration.RegistrationHandle; +import com.google.gerrit.httpd.rpc.plugin.ListPluginsServlet; import com.google.gerrit.server.MimeUtilFileTypeRegistry; import com.google.gerrit.server.config.CanonicalWebUrl; import com.google.gerrit.server.config.GerritServerConfig; @@ -79,6 +80,7 @@ class HttpPluginServlet extends HttpServlet private final Cache resourceCache; private final String sshHost; private final int sshPort; + private final ListPluginsServlet listServlet; private List pending = Lists.newArrayList(); private String base; @@ -90,10 +92,11 @@ class HttpPluginServlet extends HttpServlet @CanonicalWebUrl Provider webUrl, @Named(HttpPluginModule.PLUGIN_RESOURCES) Cache cache, @GerritServerConfig Config cfg, - SshInfo sshInfo) { + SshInfo sshInfo, ListPluginsServlet listServlet) { this.mimeUtil = mimeUtil; this.webUrl = webUrl; this.resourceCache = cache; + this.listServlet = listServlet; String sshHost = "review.example.com"; int sshPort = 29418; @@ -185,6 +188,10 @@ class HttpPluginServlet extends HttpServlet public void service(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { String name = extractName(req); + if (name.equals("")) { + listServlet.service(req, res); + return; + } final PluginHolder holder = plugins.get(name); if (holder == null) { noCache(res);