Skip to content

Commit bf5bf6f

Browse files
authored
fix: allow capital letters on host match (#1117)
While matching [user@]host[:port], we previously did not allow capital letters in host. While this makes sense for a hostname, it does not make sense to make that restriction for a host. Since this can match on both, we must widen it to accept characters allowed in host.
1 parent 7afd19f commit bf5bf6f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/remote/connutil.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"golang.org/x/crypto/ssh"
1818
)
1919

20-
var userHostRe = regexp.MustCompile(`^([a-zA-Z0-9][a-zA-Z0-9._@\\-]*@)?([a-z0-9][a-z0-9.-]*)(?::([0-9]+))?$`)
20+
var userHostRe = regexp.MustCompile(`^([a-zA-Z0-9][a-zA-Z0-9._@\\-]*@)?([a-zA-Z0-9][a-zA-Z0-9.-]*)(?::([0-9]+))?$`)
2121

2222
func ParseOpts(input string) (*SSHOpts, error) {
2323
m := userHostRe.FindStringSubmatch(input)

0 commit comments

Comments
 (0)