Skip to content

Commit 5c06b12

Browse files
committed
Default to a api.github.com host
1 parent cdcb674 commit 5c06b12

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pkg/http/oauth/oauth.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ func NewAuthHandler(cfg *Config, apiHost utils.APIHostResolver) (*AuthHandler, e
6363
cfg = &Config{}
6464
}
6565

66+
if apiHost == nil {
67+
var err error
68+
apiHost, err = utils.NewAPIHost("https://api.github.com")
69+
if err != nil {
70+
return nil, fmt.Errorf("failed to create default API host: %w", err)
71+
}
72+
}
73+
6674
return &AuthHandler{
6775
cfg: cfg,
6876
apiHost: apiHost,

0 commit comments

Comments
 (0)