mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-21 21:32:13 +01:00
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.
This commit is contained in:
parent
7afd19f000
commit
bf5bf6f00c
@ -17,7 +17,7 @@ import (
|
||||
"golang.org/x/crypto/ssh"
|
||||
)
|
||||
|
||||
var userHostRe = regexp.MustCompile(`^([a-zA-Z0-9][a-zA-Z0-9._@\\-]*@)?([a-z0-9][a-z0-9.-]*)(?::([0-9]+))?$`)
|
||||
var userHostRe = regexp.MustCompile(`^([a-zA-Z0-9][a-zA-Z0-9._@\\-]*@)?([a-zA-Z0-9][a-zA-Z0-9.-]*)(?::([0-9]+))?$`)
|
||||
|
||||
func ParseOpts(input string) (*SSHOpts, error) {
|
||||
m := userHostRe.FindStringSubmatch(input)
|
||||
|
Loading…
Reference in New Issue
Block a user