Kaynağa Gözat

added sanitization of scopes per #2483

bubble
Tony Tam 7 yıl önce
ebeveyn
işleme
47ab2a32c0
1 değiştirilmiş dosya ile 13 ekleme ve 0 silme
  1. +13
    -0
      src/main/javascript/view/Oauth2Model.js

+ 13
- 0
src/main/javascript/view/Oauth2Model.js Dosyayı Görüntüle

@@ -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);
},



Yükleniyor…
İptal
Kaydet