Skip to content

Commit a74a17e

Browse files
committed
dereference btoa before encoding
In Chrome, initial setup showed an Uncaught TypeError: Illegal Invocation Error at this point. Not sure why it wasn't working, but after dereferencing, it now encodes just fine. Related to: swagger-api#63 swagger-api#64
1 parent 2d1e790 commit a74a17e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/swagger.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1380,7 +1380,8 @@ var PasswordAuthorization = function(name, username, password) {
13801380
};
13811381

13821382
PasswordAuthorization.prototype.apply = function(obj, authorizations) {
1383-
obj.headers["Authorization"] = "Basic " + this._btoa(this.username + ":" + this.password);
1383+
var base64encoder = this._btoa;
1384+
obj.headers["Authorization"] = "Basic " + base64encoder(this.username + ":" + this.password);
13841385
return true;
13851386
};
13861387

0 commit comments

Comments
 (0)