Fix destroying response in update again
I added another reject that doesn't destroy the response.
This commit is contained in:
parent
7b2752a62c
commit
3f1750cf83
@ -111,14 +111,13 @@ export class UpdateProvider {
|
||||
|
||||
if (response.statusCode >= 300) {
|
||||
++redirects
|
||||
response.destroy()
|
||||
if (redirects > maxRedirects) {
|
||||
response.destroy()
|
||||
return reject(new Error("reached max redirects"))
|
||||
}
|
||||
if (!response.headers.location) {
|
||||
return reject(new Error("received redirect with no location header"))
|
||||
}
|
||||
response.destroy()
|
||||
return request(url.resolve(uri, response.headers.location))
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user