Fix configureHttpAuth
variable username and password are always empty ``` var username, password, httpAuthMatch = location.match(/^https?:\/\/(.+):(.+)@/i); ``` So event http.auth always pass empty values.
Showing
1 changed file
with
3 additions
and
3 deletions
... | @@ -497,7 +497,7 @@ Casper.prototype.clickLabel = function clickLabel(label, tag) { | ... | @@ -497,7 +497,7 @@ Casper.prototype.clickLabel = function clickLabel(label, tag) { |
497 | */ | 497 | */ |
498 | Casper.prototype.configureHttpAuth = function configureHttpAuth(location, settings) { | 498 | Casper.prototype.configureHttpAuth = function configureHttpAuth(location, settings) { |
499 | "use strict"; | 499 | "use strict"; |
500 | var username, password, httpAuthMatch = location.match(/^https?:\/\/(.+):(.+)@/i); | 500 | var httpAuthMatch = location.match(/^https?:\/\/(.+):(.+)@/i); |
501 | this.checkStarted(); | 501 | this.checkStarted(); |
502 | if (httpAuthMatch) { | 502 | if (httpAuthMatch) { |
503 | this.page.settings.userName = httpAuthMatch[1]; | 503 | this.page.settings.userName = httpAuthMatch[1]; |
... | @@ -508,8 +508,8 @@ Casper.prototype.configureHttpAuth = function configureHttpAuth(location, settin | ... | @@ -508,8 +508,8 @@ Casper.prototype.configureHttpAuth = function configureHttpAuth(location, settin |
508 | } else { | 508 | } else { |
509 | return; | 509 | return; |
510 | } | 510 | } |
511 | this.emit('http.auth', username, password); | 511 | this.emit('http.auth', this.page.settings.userName, this.page.settings.password); |
512 | this.log("Setting HTTP authentication for user " + username, "info"); | 512 | this.log("Setting HTTP authentication for user " + this.page.settings.userName, "info"); |
513 | return this; | 513 | return this; |
514 | }; | 514 | }; |
515 | 515 | ... | ... |
-
Please register or sign in to post a comment