diff --git a/handler/handler_test.go b/handler/handler_test.go index 13dd37d..5401a6e 100644 --- a/handler/handler_test.go +++ b/handler/handler_test.go @@ -5,6 +5,7 @@ import ( "context" "encoding/json" "fmt" + "math" "net" "net/http" "net/http/httptest" @@ -596,6 +597,18 @@ func Test_updateDialContext(t *testing.T) { }).DialContext, }, }, + { + name: "check if dialContext.timeout is negative, timeout is math.MaxInt64", + args: args{ + cfg: &http.Transport{}, + dialTimeout: -1, + }, + want: &http.Transport{ + DialContext: (&net.Dialer{ + Timeout: math.MaxInt64, + }).DialContext, + }, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) {