Skip to content

Commit 8e7700f

Browse files
committed
fix for btoa, exposed password credentials
1 parent 30f6389 commit 8e7700f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/swagger.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ var SwaggerOperation = function(nickname, path, method, parameters, summary, not
691691
}
692692

693693
SwaggerOperation.prototype.isListType = function(type) {
694-
if (type.indexOf('[') >= 0) {
694+
if (type && type.indexOf('[') >= 0) {
695695
return type.substring(type.indexOf('[') + 1, type.indexOf(']'));
696696
} else {
697697
return void 0;
@@ -1291,11 +1291,10 @@ var PasswordAuthorization = function(name, username, password) {
12911291
this.username = username;
12921292
this.password = password;
12931293
this._btoa = null;
1294-
12951294
if (typeof window !== 'undefined')
1296-
return this._btoa = btoa;
1295+
this._btoa = btoa;
12971296
else
1298-
return this._btoa = require("btoa");
1297+
this._btoa = require("btoa");
12991298
};
13001299

13011300
PasswordAuthorization.prototype.apply = function(obj, authorizations) {
@@ -1309,6 +1308,7 @@ e.SwaggerHttp = SwaggerHttp;
13091308
e.SwaggerRequest = SwaggerRequest;
13101309
e.authorizations = new SwaggerAuthorizations();
13111310
e.ApiKeyAuthorization = ApiKeyAuthorization;
1311+
e.PasswordAuthorization = PasswordAuthorization;
13121312
e.JQueryHttpClient = JQueryHttpClient;
13131313
e.ShredHttpClient = ShredHttpClient;
13141314
e.SwaggerOperation = SwaggerOperation;

0 commit comments

Comments
 (0)