From 916434182062296db2b92b41eb3c60db6226944d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C5=A1a=20=C5=BDivkov?= Date: Tue, 30 Jun 2015 12:55:04 +0200 Subject: [PATCH] Make sure /a is not in the project name for git-over-http requests The "/a" prefix is used to trigger authentication but was not removed from the request's pathInfo. Therefore, it was included in the project name and hence the project wasn't found when performing, for examples: $ git fetch http://server/a/project Change-Id: I9eadd5759d5936f040431ebbb401c35c437f537e --- .../main/java/com/google/gerrit/httpd/GitOverHttpServlet.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/GitOverHttpServlet.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/GitOverHttpServlet.java index e73f80592c..43cd741e74 100644 --- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/GitOverHttpServlet.java +++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/GitOverHttpServlet.java @@ -91,7 +91,7 @@ public class GitOverHttpServlet extends GitServlet { public static final String URL_REGEX; static { StringBuilder url = new StringBuilder(); - url.append("^(?:/p/|/)(.*/(?:info/refs"); + url.append("^(?:/a)?(?:/p/|/)(.*/(?:info/refs"); for (String name : GitSmartHttpTools.VALID_SERVICES) { url.append('|').append(name); }