aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChief <admin@117.sh>2019-08-28 18:26:13 -0400
committerChief <admin@117.sh>2019-08-28 18:26:13 -0400
commitdb0e226d48285a0ae8cda7db05d2ca20d9000dc6 (patch)
tree5008d5df1c14e2b82cdfa04461c9664d449de861
parent3e42b8cd3f20dad073db846348418aa218c7d23c (diff)
downloadgo-git-db0e226d48285a0ae8cda7db05d2ca20d9000dc6.tar.gz
Add numeric username support for SSH urls.
Signed-off-by: Chief <admin@117.sh>
-rw-r--r--internal/url/url.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/url/url.go b/internal/url/url.go
index 0f0d709..14cf133 100644
--- a/internal/url/url.go
+++ b/internal/url/url.go
@@ -6,7 +6,7 @@ import (
var (
isSchemeRegExp = regexp.MustCompile(`^[^:]+://`)
- scpLikeUrlRegExp = regexp.MustCompile(`^(?:(?P<user>[^@]+)@)?(?P<host>[^:\s]+):(?:(?P<port>[0-9]{1,5})/)?(?P<path>[^\\].*)$`)
+ scpLikeUrlRegExp = regexp.MustCompile(`^(?:(?P<user>[^@]+)@)?(?P<host>[^:\s]+):(?:(?P<port>[0-9]{1,5})(?:\/|:))?(?P<path>[^\\].*\/[^\\].*)$`)
)
// MatchesScheme returns true if the given string matches a URL-like