Skip to content

Commit

Permalink
log level fix & custom transport fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Sssilencee committed Oct 5, 2023
1 parent 7e947c4 commit a24ac88
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion e2e/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"path/filepath"
rt "runtime"
"runtime/pprof"
"strconv"
"strings"
"time"

Expand Down Expand Up @@ -222,7 +223,7 @@ var (

logLevel = flag.String(
"log-level",
logging.ErrorLevel.String(),
strconv.Itoa(logging.ErrorLevel),
"log level",
)
)
Expand Down
5 changes: 4 additions & 1 deletion pkg/drivers/http/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ func addProxy(httpClient *pester.Client, proxyStr string) error {
proxy := http.ProxyURL(proxyURL)

if httpClient.Transport != nil {
httpClient.Transport.(*http.Transport).Proxy = proxy
transport, isHTTPTransport := httpClient.Transport.(*http.Transport)
if isHTTPTransport {
transport.Proxy = proxy
}

return nil
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/drivers/http/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type (
Concurrency int
BodyLimit int64
HTTPCodesFilter []compiledStatusCodeFilter
HTTPTransport *stdhttp.Transport
HTTPTransport stdhttp.RoundTripper
Timeout time.Duration
MaxRedirectsLimit uint8
}
Expand Down Expand Up @@ -144,7 +144,7 @@ func WithAllowedHTTPCodes(httpCodes []int) Option {
}
}

func WithCustomTransport(transport *stdhttp.Transport) Option {
func WithCustomTransport(transport stdhttp.RoundTripper) Option {
return func(opts *Options) {
opts.HTTPTransport = transport
}
Expand Down

0 comments on commit a24ac88

Please sign in to comment.