Skip to content

Commit

Permalink
fix: change abort listener to aborted event (#8282)
Browse files Browse the repository at this point in the history
  • Loading branch information
beyondkmp committed Aug 11, 2024
1 parent 5fae1cf commit 15ce5b4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/strong-spiders-grab.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"electron-updater": patch
---

fix aborted event
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export abstract class DifferentialDownloader {

const request = this.httpExecutor.createRequest(requestOptions, response => {
response.on("error", reject)
response.on("abort", () => {
response.on("aborted", () => {
reject(new Error("response has been aborted by the server"))
})
// Electron net handles redirects automatically, our NodeJS test server doesn't use redirects - so, we don't check 3xx codes.
Expand Down Expand Up @@ -295,6 +295,11 @@ export abstract class DifferentialDownloader {
return
}

response.on("error", reject)
response.on("aborted", () => {
reject(new Error("response has been aborted by the server"))
})

response.on("data", dataHandler)
response.on("end", () => resolve())
})
Expand Down

0 comments on commit 15ce5b4

Please sign in to comment.