Skip to content

Commit 19287ab

Browse files
authored
fix http client configuration (#29)
1 parent 3dc3c4e commit 19287ab

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.idea

flashbotsrpc.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,14 @@ func New(url string, options ...func(rpc *FlashbotsRPC)) *FlashbotsRPC {
6262
Headers: make(map[string]string),
6363
Timeout: 30 * time.Second,
6464
}
65-
for _, option := range options {
66-
option(rpc)
67-
}
65+
6866
rpc.client = &http.Client{
6967
Timeout: rpc.Timeout,
7068
}
69+
// this way if client is set explicitly it overwrites timeout preferences set above
70+
for _, option := range options {
71+
option(rpc)
72+
}
7173
return rpc
7274
}
7375

0 commit comments

Comments
 (0)