We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Authorization
token
1 parent 12cbac6 commit b755d64Copy full SHA for b755d64
github/github.go
@@ -355,7 +355,9 @@ func (c *Client) WithAuthToken(token string) *Client {
355
c2.client.Transport = roundTripperFunc(
356
func(req *http.Request) (*http.Response, error) {
357
req = req.Clone(req.Context())
358
- req.Header.Set("Authorization", fmt.Sprintf("Bearer %v", token))
+ if token != "" {
359
+ req.Header.Set("Authorization", fmt.Sprintf("Bearer %v", token))
360
+ }
361
return transport.RoundTrip(req)
362
},
363
)
0 commit comments