diff options
| author | s <[email protected]> | 2025-11-19 12:39:35 -0500 |
|---|---|---|
| committer | s <[email protected]> | 2025-11-19 12:39:35 -0500 |
| commit | 0c209ada2314cb5e4cf123477ee246b5afc70939 (patch) | |
| tree | f649912fac342f3a8cded6fdfa26e2dc56ebcb06 /internal/client/github.go | |
| parent | d77b81ec36a6995af6a8039121d19802bab8352e (diff) | |
| download | dborg-0.8.6.tar.gz dborg-0.8.6.zip | |
refactor: switch to authenticated client and update github lead model to use profile data instead of commit metadatav1.0.4v0.8.6
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) } |
