File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -27,9 +27,6 @@ function getFileDownloadURLRedirect(url: string): Promise<string> {
2727 console . log ( 'Headers:' , response . headers )
2828 const statusCode = response . statusCode
2929 const location = response . headers . location
30- let data = ''
31- response . on ( 'data' , d => data += d )
32- response . on ( 'end' , ( ) => console . log ( 'Data:' , data ) )
3330
3431 if ( statusCode !== 302 ) {
3532 request . destroy ( ) ;
@@ -39,10 +36,12 @@ function getFileDownloadURLRedirect(url: string): Promise<string> {
3936 }
4037
4138 if ( typeof location === 'string' && location . length > 0 ) {
39+ request . destroy ( )
4240 resolve ( location )
4341 return
4442 }
4543
44+ request . destroy ( )
4645 reject ( `Received incorrect URL information. Expected a non-empty string. Received: ${ JSON . stringify ( location ) } ` )
4746 } )
4847
You can’t perform that action at this time.
0 commit comments