Merge "Do not return 403 when clicking on Gitweb breadcrumb" into stable-2.11

This commit is contained in:
Edwin Kempin 2015-03-05 09:59:13 +00:00 committed by Gerrit Code Review
commit 7c2b0fde46

View File

@ -29,6 +29,7 @@
package com.google.gerrit.httpd.gitweb;
import com.google.gerrit.common.PageLinks;
import com.google.gerrit.common.data.GerritConfig;
import com.google.gerrit.extensions.restapi.Url;
import com.google.gerrit.httpd.GitWebConfig;
@ -79,6 +80,8 @@ class GitWebServlet extends HttpServlet {
private static final Logger log =
LoggerFactory.getLogger(GitWebServlet.class);
private static final String PROJECT_LIST_ACTION = "project_list";
private final Set<String> deniedActions;
private final int bufferSize = 8192;
private final File gitwebCgi;
@ -119,7 +122,6 @@ class GitWebServlet extends HttpServlet {
deniedActions.add("forks");
deniedActions.add("opml");
deniedActions.add("project_list");
deniedActions.add("project_index");
_env = new EnvList();
@ -363,6 +365,12 @@ class GitWebServlet extends HttpServlet {
return;
}
if (params.get("a").equals(PROJECT_LIST_ACTION)) {
rsp.sendRedirect(req.getContextPath() + "/#" + PageLinks.ADMIN_PROJECTS
+ "?filter=" + Url.encode(params.get("pf") + "/"));
return;
}
String name = params.get("p");
if (name == null) {
rsp.sendError(HttpServletResponse.SC_NOT_FOUND);