File tree 2 files changed +21
-0
lines changed
packages/hardhat-core/src/internal/hardhat-network/provider
2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " hardhat " : patch
3
+ ---
4
+
5
+ Fixed broken HTTP headers for forked configurations
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import type {
16
16
RawTrace ,
17
17
Response ,
18
18
SubscriptionEvent ,
19
+ HttpHeader ,
19
20
} from "@nomicfoundation/edr" ;
20
21
import { Common } from "@nomicfoundation/ethereumjs-common" ;
21
22
import chalk from "chalk" ;
@@ -201,12 +202,27 @@ export class EdrProviderWrapper
201
202
202
203
let fork ;
203
204
if ( config . forkConfig !== undefined ) {
205
+ let httpHeaders : HttpHeader [ ] | undefined ;
206
+ if ( config . forkConfig . httpHeaders !== undefined ) {
207
+ httpHeaders = [ ] ;
208
+
209
+ for ( const [ name , value ] of Object . entries (
210
+ config . forkConfig . httpHeaders
211
+ ) ) {
212
+ httpHeaders . push ( {
213
+ name,
214
+ value,
215
+ } ) ;
216
+ }
217
+ }
218
+
204
219
fork = {
205
220
jsonRpcUrl : config . forkConfig . jsonRpcUrl ,
206
221
blockNumber :
207
222
config . forkConfig . blockNumber !== undefined
208
223
? BigInt ( config . forkConfig . blockNumber )
209
224
: undefined ,
225
+ httpHeaders,
210
226
} ;
211
227
}
212
228
You can’t perform that action at this time.
0 commit comments