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:
Shawn O. Pearce
2009-11-12 12:53:33 -08:00
parent f9fbae77fd
commit 382368c185

View File

@@ -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);