diff --git a/internal/vcs/url.go b/internal/vcs/url.go index b6a5441a20b..87be01f4715 100644 --- a/internal/vcs/url.go +++ b/internal/vcs/url.go @@ -67,6 +67,12 @@ var schemes = map[string]struct{}{ "rsync": {}, "file": {}, "perforce": {}, + // This is not an officially supported git protocol, and it will not work + // without adding an override to the global git config for iap:// to https://. + // This has been added as a response to a customer issue where their GitLab + // instance reports a URL with the iap:// scheme. + // https://github.com/sourcegraph/accounts/issues/2379 + "iap": {}, } func parseScheme(rawurl string) (*URL, error) { diff --git a/internal/vcs/url_test.go b/internal/vcs/url_test.go index 83407f493d5..0618c09bc1f 100644 --- a/internal/vcs/url_test.go +++ b/internal/vcs/url_test.go @@ -215,6 +215,12 @@ func TestParseURL(t *testing.T) { formatStdlib, "perforce", "admin:pa$$word", "ssl:192.168.1.100:1666", "//Sourcegraph/", "perforce://admin:pa$$word@ssl:192.168.1.100:1666//Sourcegraph/", "", ), + // iap:// + newParseURLTest( + "iap://admin:pa$$word@gitlab.sgdev.org/test/repo.git", + formatStdlib, "iap", "admin:pa$$word", "gitlab.sgdev.org", "/test/repo.git", + "iap://admin:pa$$word@gitlab.sgdev.org/test/repo.git", "", + ), } for _, tt := range tests {