File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import { getBasicAuthorizationHeader } from './utils/get_basic';
1313
1414interface Options {
1515 method : string ;
16- headers : string [ ] ;
16+ headers : Record < string , string > ;
1717 path ?: string ;
1818 localAddress ?: string ;
1919 family ?: number ;
@@ -71,25 +71,24 @@ export const chain = (
7171 const options : Options = {
7272 method : 'CONNECT' ,
7373 path : request . url ,
74- headers : [
75- 'host' ,
76- request . url ! ,
77- ] ,
74+ headers : {
75+ host : request . url ! ,
76+ } ,
7877 localAddress : handlerOpts . localAddress ,
7978 family : handlerOpts . ipFamily ,
8079 lookup : handlerOpts . dnsLookup ,
8180 } ;
8281
8382 if ( proxy . username || proxy . password ) {
84- options . headers . push ( 'proxy-authorization' , getBasicAuthorizationHeader ( proxy ) ) ;
83+ options . headers [ 'proxy-authorization' ] = getBasicAuthorizationHeader ( proxy ) ;
8584 }
8685
8786 const client = proxy . protocol === 'https:'
8887 ? https . request ( proxy . origin , {
89- ...options as unknown as https . RequestOptions ,
88+ ...options ,
9089 rejectUnauthorized : ! handlerOpts . ignoreUpstreamProxyCertificate ,
9190 } )
92- : http . request ( proxy . origin , options as unknown as http . RequestOptions ) ;
91+ : http . request ( proxy . origin , options ) ;
9392
9493 client . once ( 'socket' , ( targetSocket : SocketWithPreviousStats ) => {
9594 // Socket can be re-used by multiple requests.
You can’t perform that action at this time.
0 commit comments