File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -88,12 +88,8 @@ class Request implements HttpRequest {
8888 }
8989
9090 return new Promise ( ( resolve , reject ) => {
91- const parsedUrl = new URL ( this . _url )
91+ const url = new URL ( this . _url )
9292 const options = {
93- protocol : parsedUrl . protocol ,
94- hostname : parsedUrl . hostname ,
95- port : parsedUrl . port ,
96- path : parsedUrl . pathname + parsedUrl . search ,
9793 ...this . _requestOptions ,
9894
9995 method : this . _method ,
@@ -110,8 +106,8 @@ class Request implements HttpRequest {
110106 options . headers [ 'Content-Length' ] = body . size
111107 }
112108
113- const httpModule = options . protocol === 'https:' ? https : http
114- this . _request = httpModule . request ( options )
109+ const httpModule = url . protocol === 'https:' ? https : http
110+ this . _request = httpModule . request ( url , options )
115111 const req = this . _request
116112 req . on ( 'response' , ( res ) => {
117113 const resChunks : Buffer [ ] = [ ]
You can’t perform that action at this time.
0 commit comments