mirror of
https://github.com/trufflesecurity/trufflehog.git
synced 2024-11-10 07:04:24 +00:00
remove logger from retryable client, it is not respecting loglevels (#1020)
This commit is contained in:
parent
45b02f46d9
commit
bc27fef7bc
1 changed files with 3 additions and 4 deletions
|
@ -9,7 +9,6 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/hashicorp/go-retryablehttp"
|
"github.com/hashicorp/go-retryablehttp"
|
||||||
"github.com/sirupsen/logrus"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var caCerts = []string{
|
var caCerts = []string{
|
||||||
|
@ -94,7 +93,7 @@ func NewCustomTransport(T http.RoundTripper) *CustomTransport {
|
||||||
|
|
||||||
func PinnedRetryableHttpClient() *http.Client {
|
func PinnedRetryableHttpClient() *http.Client {
|
||||||
httpClient := retryablehttp.NewClient()
|
httpClient := retryablehttp.NewClient()
|
||||||
httpClient.Logger = logrus.WithField("name", "PinnedRetryableHttpClient").WithField("level", logrus.DebugLevel)
|
httpClient.Logger = nil
|
||||||
httpClient.HTTPClient.Transport = NewCustomTransport(&http.Transport{
|
httpClient.HTTPClient.Transport = NewCustomTransport(&http.Transport{
|
||||||
TLSClientConfig: &tls.Config{
|
TLSClientConfig: &tls.Config{
|
||||||
RootCAs: PinnedCertPool(),
|
RootCAs: PinnedCertPool(),
|
||||||
|
@ -116,7 +115,7 @@ func PinnedRetryableHttpClient() *http.Client {
|
||||||
func RetryableHttpClient() *http.Client {
|
func RetryableHttpClient() *http.Client {
|
||||||
httpClient := retryablehttp.NewClient()
|
httpClient := retryablehttp.NewClient()
|
||||||
httpClient.RetryMax = 3
|
httpClient.RetryMax = 3
|
||||||
httpClient.Logger = logrus.WithField("name", "RetryableHttpClient").WithField("level", logrus.DebugLevel)
|
httpClient.Logger = nil
|
||||||
httpClient.HTTPClient.Timeout = 3 * time.Second
|
httpClient.HTTPClient.Timeout = 3 * time.Second
|
||||||
httpClient.HTTPClient.Transport = NewCustomTransport(nil)
|
httpClient.HTTPClient.Transport = NewCustomTransport(nil)
|
||||||
return httpClient.StandardClient()
|
return httpClient.StandardClient()
|
||||||
|
@ -125,7 +124,7 @@ func RetryableHttpClient() *http.Client {
|
||||||
func RetryableHttpClientTimeout(timeOutSeconds int64) *http.Client {
|
func RetryableHttpClientTimeout(timeOutSeconds int64) *http.Client {
|
||||||
httpClient := retryablehttp.NewClient()
|
httpClient := retryablehttp.NewClient()
|
||||||
httpClient.RetryMax = 3
|
httpClient.RetryMax = 3
|
||||||
httpClient.Logger = logrus.WithField("name", "RetryableHttpClientTimeout").WithField("level", logrus.DebugLevel)
|
httpClient.Logger = nil
|
||||||
httpClient.HTTPClient.Timeout = time.Duration(timeOutSeconds) * time.Second
|
httpClient.HTTPClient.Timeout = time.Duration(timeOutSeconds) * time.Second
|
||||||
httpClient.HTTPClient.Transport = NewCustomTransport(nil)
|
httpClient.HTTPClient.Transport = NewCustomTransport(nil)
|
||||||
return httpClient.StandardClient()
|
return httpClient.StandardClient()
|
||||||
|
|
Loading…
Reference in a new issue