Commit e14544ab e14544abfae194c4b2061fe10824051cc0fe68dc by Nicolas Perriault

Merge pull request #848 from franck34/master

Fix configureHttpAuth
2 parents 98021323 21277da8
...@@ -498,7 +498,7 @@ Casper.prototype.clickLabel = function clickLabel(label, tag) { ...@@ -498,7 +498,7 @@ Casper.prototype.clickLabel = function clickLabel(label, tag) {
498 */ 498 */
499 Casper.prototype.configureHttpAuth = function configureHttpAuth(location, settings) { 499 Casper.prototype.configureHttpAuth = function configureHttpAuth(location, settings) {
500 "use strict"; 500 "use strict";
501 var username, password, httpAuthMatch = location.match(/^https?:\/\/(.+):(.+)@/i); 501 var httpAuthMatch = location.match(/^https?:\/\/(.+):(.+)@/i);
502 this.checkStarted(); 502 this.checkStarted();
503 if (httpAuthMatch) { 503 if (httpAuthMatch) {
504 this.page.settings.userName = httpAuthMatch[1]; 504 this.page.settings.userName = httpAuthMatch[1];
...@@ -509,8 +509,8 @@ Casper.prototype.configureHttpAuth = function configureHttpAuth(location, settin ...@@ -509,8 +509,8 @@ Casper.prototype.configureHttpAuth = function configureHttpAuth(location, settin
509 } else { 509 } else {
510 return; 510 return;
511 } 511 }
512 this.emit('http.auth', username, password); 512 this.emit('http.auth', this.page.settings.userName, this.page.settings.password);
513 this.log("Setting HTTP authentication for user " + username, "info"); 513 this.log("Setting HTTP authentication for user " + this.page.settings.userName, "info");
514 return this; 514 return this;
515 }; 515 };
516 516
......