瀏覽代碼

fix(settings): respect configWhitelist

j8
Hristo Terezov 6 年之前
父節點
當前提交
5da4e43e50
共有 2 個檔案被更改,包括 10 行新增8 行删除
  1. 1
    0
      react/features/base/config/index.js
  2. 9
    8
      react/features/base/settings/functions.any.js

+ 1
- 0
react/features/base/config/index.js 查看文件

1
 export * from './actions';
1
 export * from './actions';
2
 export * from './actionTypes';
2
 export * from './actionTypes';
3
+export { default as CONFIG_WHITELIST } from './configWhitelist';
3
 export * from './functions';
4
 export * from './functions';
4
 
5
 
5
 import './middleware';
6
 import './middleware';

+ 9
- 8
react/features/base/settings/functions.any.js 查看文件

1
 // @flow
1
 // @flow
2
-
3
-import { parseURLParams } from '../config';
2
+import { CONFIG_WHITELIST, parseURLParams } from '../config';
4
 import { toState } from '../redux';
3
 import { toState } from '../redux';
5
 
4
 
6
 import { DEFAULT_SERVER_URL } from './constants';
5
 import { DEFAULT_SERVER_URL } from './constants';
55
 
54
 
56
     // urlParams
55
     // urlParams
57
     if (sources.urlParams) {
56
     if (sources.urlParams) {
58
-        const urlParams
59
-            = parseURLParams(state['features/base/connection'].locationURL);
60
-        const value = urlParams[`config.${propertyName}`];
61
-
62
-        if (typeof value !== 'undefined') {
63
-            return value;
57
+        if (CONFIG_WHITELIST.indexOf(propertyName) !== -1) {
58
+            const urlParams
59
+                = parseURLParams(state['features/base/connection'].locationURL);
60
+            const value = urlParams[`config.${propertyName}`];
61
+
62
+            if (typeof value !== 'undefined') {
63
+                return value;
64
+            }
64
         }
65
         }
65
     }
66
     }
66
 
67
 

Loading…
取消
儲存