-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(download): wait for response end
The `DropboxService` was not handling calls to `https.get` appropriately when downloading files. The code was resolving the promise after receiving a `close` event from the request. This could result in the promise resolving before the file had finished downloading. In addition, the code was not verifying the status code of the response was a successful code. Changes: * Resolve the promise when the request emits an `end` event and not when the response emits a `close` event. * If the response status code is not a successful code then reject the promise.
- Loading branch information
Showing
2 changed files
with
101 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters