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
This commit is contained in:
Saša Živkov 2015-06-30 12:55:04 +02:00 committed by Edwin Kempin
parent b2c2a03a07
commit 9164341820

View File

@ -91,7 +91,7 @@ public class GitOverHttpServlet extends GitServlet {
public static final String URL_REGEX; public static final String URL_REGEX;
static { static {
StringBuilder url = new StringBuilder(); StringBuilder url = new StringBuilder();
url.append("^(?:/p/|/)(.*/(?:info/refs"); url.append("^(?:/a)?(?:/p/|/)(.*/(?:info/refs");
for (String name : GitSmartHttpTools.VALID_SERVICES) { for (String name : GitSmartHttpTools.VALID_SERVICES) {
url.append('|').append(name); url.append('|').append(name);
} }