Pass a copy of the object rather than a reference so clientutils cant modify casper.options
Showing
1 changed file
with
1 additions
and
1 deletions
... | @@ -455,7 +455,7 @@ Casper.prototype.die = function die(message, status) { | ... | @@ -455,7 +455,7 @@ Casper.prototype.die = function die(message, status) { |
455 | */ | 455 | */ |
456 | Casper.prototype.download = function download(url, targetPath, method, data) { | 456 | Casper.prototype.download = function download(url, targetPath, method, data) { |
457 | "use strict"; | 457 | "use strict"; |
458 | var cu = require('clientutils').create(this.options); | 458 | var cu = require('clientutils').create(utils.mergeObjects({}, this.options)); |
459 | try { | 459 | try { |
460 | fs.write(targetPath, cu.decode(this.base64encode(url, method, data)), 'wb'); | 460 | fs.write(targetPath, cu.decode(this.base64encode(url, method, data)), 'wb'); |
461 | this.emit('downloaded.file', targetPath); | 461 | this.emit('downloaded.file', targetPath); | ... | ... |
-
Please register or sign in to post a comment