Fix ssh:// URLs on change pages when sshd.listenAddress is *:29418
We don't want to include the * in the SSH hostname, its not a valid host component in a URL. Skip over it since we've added the host from Window.Location.getHostName(). Change-Id: I55dc0e4eca6bc1a3f9990ae1725939e219a8c6a0 Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
@@ -159,7 +159,7 @@ class PatchSetPanel extends Composite implements OpenHandler<DisclosurePanel> {
|
||||
// Use our SSH daemon URL as its the only way they can get
|
||||
// to the project (that we know of anyway).
|
||||
//
|
||||
final String sshAddr = Gerrit.getConfig().getSshdAddress();
|
||||
String sshAddr = Gerrit.getConfig().getSshdAddress();
|
||||
final StringBuilder r = new StringBuilder();
|
||||
r.append("git pull ssh://");
|
||||
r.append(Gerrit.getUserAccount().getSshUserName());
|
||||
@@ -167,6 +167,9 @@ class PatchSetPanel extends Composite implements OpenHandler<DisclosurePanel> {
|
||||
if (sshAddr.startsWith("*:") || "".equals(sshAddr)) {
|
||||
r.append(Window.Location.getHostName());
|
||||
}
|
||||
if (sshAddr.startsWith("*")) {
|
||||
sshAddr = sshAddr.substring(1);
|
||||
}
|
||||
r.append(sshAddr);
|
||||
r.append("/");
|
||||
r.append(projectName);
|
||||
|
||||
Reference in New Issue
Block a user