Merge branch 'stable-2.10'
* stable-2.10: Fix login redirect for non default (root) context Conflicts: gerrit-httpd/src/main/java/com/google/gerrit/httpd/auth/become/BecomeAnyAccountLoginServlet.java Change-Id: I5b6479eeaaca467b68c568e7bd372e61198e2165
This commit is contained in:
@@ -409,8 +409,13 @@ class GitWebServlet extends HttpServlet {
|
||||
}
|
||||
|
||||
private static String getLoginRedirectUrl(HttpServletRequest req) {
|
||||
String loginUrl = req.getContextPath() + "/login/";
|
||||
String token = req.getRequestURI().substring(1);
|
||||
String contextPath = req.getContextPath();
|
||||
String loginUrl = contextPath + "/login/";
|
||||
String token = req.getRequestURI();
|
||||
if (!contextPath.isEmpty()) {
|
||||
token = token.substring(contextPath.length());
|
||||
}
|
||||
|
||||
String queryString = req.getQueryString();
|
||||
if (queryString != null && !queryString.isEmpty()) {
|
||||
token = token.concat("?" + queryString);
|
||||
|
||||
Reference in New Issue
Block a user