File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -228,20 +228,19 @@ async function createUploadRequest(
228
228
229
229
// Send the headers now. If the server would reject this request, it should
230
230
// do so asap. This prevents us from sending more data to it then necessary.
231
- // If it will reject we could just await the `req.on(response` now but if it
232
- // accepts the request then the response will not come until after the final
233
- // file. So we can't await the response at this time. Just proceed, carefully.
231
+ // If it will reject we could just await the `req.on(response, ...` now but
232
+ // if it accepts the request then the response will not come until after the
233
+ // final file. So we can't await the response at this time. Just proceed,
234
+ // carefully.
234
235
req . flushHeaders ( )
235
236
236
237
// Wait for the response. It may arrive at any point during the request or
237
238
// afterwards. Node will flush the output buffer at some point, initiating
238
239
// the request, and the server can decide to reject the request immediately
239
240
// or at any point later (ike a timeout). We should handle those cases.
240
241
getResponse ( req ) . then (
241
- res => {
242
- // Note: this returns the response to the caller to createUploadRequest
243
- pass ( res )
244
- } ,
242
+ // Note: this returns the response to the caller to createUploadRequest.
243
+ pass ,
245
244
async err => {
246
245
// Note: this will throw an error for the caller to createUploadRequest
247
246
if ( err . response && ! isResponseOk ( err . response ) ) {
@@ -305,8 +304,6 @@ async function createUploadRequest(
305
304
req . end ( )
306
305
}
307
306
}
308
-
309
- pass ( getResponse ( req ) )
310
307
} )
311
308
}
312
309
You can’t perform that action at this time.
0 commit comments