Skip to content

Commit

Permalink
add InsecureSkipVerify for github client
Browse files Browse the repository at this point in the history
  • Loading branch information
madneal committed Mar 16, 2024
1 parent 2506098 commit af17f58
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion server/search/githubsearch/gitclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ package githubsearch

import (
"context"
"crypto/tls"
"errors"
"github.com/google/go-github/v57/github"
"github.com/madneal/gshark/model"
"net/http"

"github.com/madneal/gshark/service"
)
Expand All @@ -21,10 +23,14 @@ type Client struct {

func InitGithubClients(tokens []model.Token) map[string]*Client {
githubClients := make(map[string]*Client)
httpTransport := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}
httpClient := &http.Client{Transport: httpTransport}
for _, token := range tokens {
githubToken := token.Content
if githubToken != "" {
gitClient := github.NewClient(nil).WithAuthToken(githubToken)
gitClient := github.NewClient(httpClient).WithAuthToken(githubToken)
githubClients[token.Content] = NewGitClient(gitClient, githubToken)
}
}
Expand Down

0 comments on commit af17f58

Please sign in to comment.