Skip to content

Commit f3ede2d

Browse files
committed
fix: change transport signature
1 parent 266683b commit f3ede2d

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

main.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,13 @@ func New(ctx context.Context, next http.Handler, config *Config, name string) (h
128128

129129
// Create a custom HTTP client with proper timeouts
130130
transport := &http.Transport{
131-
DialContext: (&net.Dialer{
132-
Timeout: timeout / 3,
133-
KeepAlive: 30 * time.Second,
134-
}).DialContext,
131+
DialContext: func(ctx context.Context, network, addr string) (net.Conn, error) {
132+
dialer := &net.Dialer{
133+
Timeout: timeout / 3,
134+
KeepAlive: 30 * time.Second,
135+
}
136+
return dialer.DialContext(ctx, network, addr)
137+
},
135138
MaxIdleConns: 100,
136139
IdleConnTimeout: 90 * time.Second,
137140
TLSHandshakeTimeout: timeout / 3,

0 commit comments

Comments
 (0)