Selaa lähdekoodia

added sanitization of scopes per #2483

bubble
Tony Tam 7 vuotta sitten
vanhempi
commit
47ab2a32c0
1 muutettua tiedostoa jossa 13 lisäystä ja 0 poistoa
  1. +13
    -0
      src/main/javascript/view/Oauth2Model.js

+ 13
- 0
src/main/javascript/view/Oauth2Model.js Näytä tiedosto

@@ -6,6 +6,19 @@ SwaggerUi.Models.Oauth2Model = Backbone.Model.extend({
},

initialize: function () {
if(this.attributes && this.attributes.scopes) {
var attributes = _.cloneDeep(this.attributes);
var i, scopes = [];
for(i in attributes.scopes) {
var scope = attributes.scopes[i];
if(typeof scope.description === 'string') {
scopes[scope] = attributes.scopes[i];
scopes.push(attributes.scopes[i]);
}
}
attributes.scopes = scopes;
this.attributes = attributes;
}
this.on('change', this.validate);
},



Ladataan…
Peruuta
Tallenna