We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Authorization
token
1 parent 98a62fd commit cdc8ba1Copy full SHA for cdc8ba1
1 file changed
github/github.go
@@ -354,7 +354,9 @@ func (c *Client) WithAuthToken(token string) *Client {
354
c2.client.Transport = roundTripperFunc(
355
func(req *http.Request) (*http.Response, error) {
356
req = req.Clone(req.Context())
357
- req.Header.Set("Authorization", fmt.Sprintf("Bearer %v", token))
+ if token != "" {
358
+ req.Header.Set("Authorization", fmt.Sprintf("Bearer %v", token))
359
+ }
360
return transport.RoundTrip(req)
361
},
362
)
0 commit comments