Skip to content

Commit 662f83f

Browse files
committed
Fix release download
Only ever try to set an `Authorization` request header to hosts that we have OAuth credentials for; skip the header otherwise.
1 parent b34fe81 commit 662f83f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/cmd/factory/http.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func NewHTTPClient(io *iostreams.IOStreams, cfg config.Config, appVersion string
2424
api.AddHeader("User-Agent", fmt.Sprintf("GitHub CLI %s", appVersion)),
2525
api.AddHeaderFunc("Authorization", func(req *http.Request) (string, error) {
2626
hostname := ghinstance.NormalizeHostname(req.URL.Hostname())
27-
if token, err := cfg.Get(hostname, "oauth_token"); err == nil || token != "" {
27+
if token, err := cfg.Get(hostname, "oauth_token"); err == nil && token != "" {
2828
return fmt.Sprintf("token %s", token), nil
2929
}
3030
return "", nil

0 commit comments

Comments
 (0)