Skip to content

Commit 3ec3c34

Browse files
authored
If the instance url is set and it is github.com, use a standard client (#12)
* If the instance url is set and it is github.com, use a standard client * Actually use githubDotCom constant
1 parent fb2185a commit 3ec3c34

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/connector/connector.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ import (
1717
"google.golang.org/grpc/status"
1818
)
1919

20+
const githubDotCom = "https://github.com"
21+
2022
var ValidAssetDomains = []string{"avatars.githubusercontent.com"}
2123

2224
var (
@@ -139,7 +141,8 @@ func newGithubClient(ctx context.Context, instanceURL string, accessToken string
139141
)
140142
tc := oauth2.NewClient(ctx, ts)
141143

142-
if instanceURL != "" {
144+
instanceURL = strings.TrimSuffix(instanceURL, "/")
145+
if instanceURL != "" && instanceURL != githubDotCom {
143146
return github.NewEnterpriseClient(instanceURL, instanceURL, tc)
144147
}
145148

0 commit comments

Comments
 (0)