diff options
Diffstat (limited to 'internal/client/github.go')
| -rw-r--r-- | internal/client/github.go | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/internal/client/github.go b/internal/client/github.go index 35e8b2c..ab3f788 100644 --- a/internal/client/github.go +++ b/internal/client/github.go @@ -23,6 +23,7 @@ func (c *Client) SearchGitHubLeads(query string, callback func(result json.RawMe return fmt.Errorf("failed to create request: %w", err) } + req.Header.Set("X-API-Key", c.config.APIKey) req.Header.Set("User-Agent", c.config.UserAgent) req.Header.Set("Accept", "application/x-ndjson, application/json") @@ -88,20 +89,11 @@ func (c *Client) SearchGitHubLeadsWithParams(query, sort, exclude, format, bio s return fmt.Errorf("failed to create request: %w", err) } + req.Header.Set("X-API-Key", c.config.APIKey) req.Header.Set("User-Agent", c.config.UserAgent) req.Header.Set("Accept", "application/x-ndjson, application/json") - req.Header.Set("Connection", "keep-alive") - req.ProtoMajor = 1 - req.ProtoMinor = 1 - http1Client := &http.Client{ - Timeout: c.config.Timeout, - Transport: &http.Transport{ - ForceAttemptHTTP2: false, - }, - } - - resp, err := http1Client.Do(req) + resp, err := c.httpClient.Do(req) if err != nil { return fmt.Errorf("failed to execute request: %w", err) } |
