Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ef7ce56

Browse files
committed
Fix destroying response in update again
I added another reject that doesn't destroy the response.
1 parent c1f4484 commit ef7ce56

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/node/update.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,13 @@ export class UpdateProvider {
111111

112112
if (response.statusCode >= 300) {
113113
++redirects
114+
response.destroy()
114115
if (redirects > maxRedirects) {
115-
response.destroy()
116116
return reject(new Error("reached max redirects"))
117117
}
118118
if (!response.headers.location) {
119119
return reject(new Error("received redirect with no location header"))
120120
}
121-
response.destroy()
122121
return request(url.resolve(uri, response.headers.location))
123122
}
124123

0 commit comments

Comments
 (0)