Fix login redirect for non default (root) context
Login redirection was working fine when gerrit is deployed in the root context but did not otherwise. Issue: 2990 Change-Id: I851d45d4b9de1f70e45cdd5daaa838546dae02db
This commit is contained in:
@@ -337,14 +337,7 @@ public class Gerrit implements EntryPoint {
|
||||
token = token.substring(1);
|
||||
}
|
||||
|
||||
UrlBuilder builder = new UrlBuilder();
|
||||
builder.setProtocol(Location.getProtocol());
|
||||
builder.setHost(Location.getHost());
|
||||
String port = Location.getPort();
|
||||
if (port != null && !port.isEmpty()) {
|
||||
builder.setPort(Integer.parseInt(port));
|
||||
}
|
||||
return builder.buildString() + ("/login/" + URL.encodePathSegment("#/" + token));
|
||||
return selfRedirect("login/") + URL.encodePathSegment("#/" + token);
|
||||
}
|
||||
|
||||
public static String selfRedirect(String suffix) {
|
||||
|
||||
Reference in New Issue
Block a user