Commit d6c11e45 d6c11e45bafb0c01cdc5a584942bef06eb9365f9 by Chris Lorenzo

Pass a copy of the object rather than a reference so clientutils cant modify casper.options

1 parent 9211f91f
...@@ -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);
......