Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,9 @@ func (c *Client) WithAuthToken(token string) *Client {
c2.client.Transport = roundTripperFunc(
func(req *http.Request) (*http.Response, error) {
req = req.Clone(req.Context())
req.Header.Set("Authorization", fmt.Sprintf("Bearer %v", token))
if token != "" {
req.Header.Set("Authorization", fmt.Sprintf("Bearer %v", token))
}
Comment on lines +357 to +359
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have a test for this #3790

return transport.RoundTrip(req)
},
)
Expand Down
Loading