瀏覽代碼

added sanitization of scopes per #2483

bubble
Tony Tam 7 年之前
父節點
當前提交
47ab2a32c0
共有 1 個文件被更改,包括 13 次插入0 次删除
  1. +13
    -0
      src/main/javascript/view/Oauth2Model.js

+ 13
- 0
src/main/javascript/view/Oauth2Model.js 查看文件

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



Loading…
取消
儲存