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) {
|
if (response.statusCode >= 300) {
|
||||||
++redirects
|
++redirects
|
||||||
if (redirects > maxRedirects) {
|
|
||||||
response.destroy()
|
response.destroy()
|
||||||
|
if (redirects > maxRedirects) {
|
||||||
return reject(new Error("reached max redirects"))
|
return reject(new Error("reached max redirects"))
|
||||||
}
|
}
|
||||||
if (!response.headers.location) {
|
if (!response.headers.location) {
|
||||||
return reject(new Error("received redirect with no location header"))
|
return reject(new Error("received redirect with no location header"))
|
||||||
}
|
}
|
||||||
response.destroy()
|
|
||||||
return request(url.resolve(uri, response.headers.location))
|
return request(url.resolve(uri, response.headers.location))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user