mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-13 21:12:53 -04:00
delete temp file when download is redirected (#6877)
This commit is contained in:
parent
1f83b7927a
commit
0d346b1d62
@ -381,7 +381,10 @@ module.exports.pluginHandler = function (parent) {
|
|||||||
}
|
}
|
||||||
var request = http.get(opts, function (response) {
|
var request = http.get(opts, function (response) {
|
||||||
// handle redirections with grace
|
// handle redirections with grace
|
||||||
if (response.headers.location) return obj.installPlugin(id, version_only, response.headers.location, func);
|
if (response.headers.location) {
|
||||||
|
file.close(function () { obj.fs.unlink(file.path, function(err) { void err; }); });
|
||||||
|
return obj.installPlugin(id, version_only, response.headers.location, func);
|
||||||
|
}
|
||||||
response.pipe(file);
|
response.pipe(file);
|
||||||
file.on('finish', function () {
|
file.on('finish', function () {
|
||||||
file.close(function () {
|
file.close(function () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user