Pārlūkot izejas kodu

fix(settings): respect configWhitelist

master
Hristo Terezov 6 gadus atpakaļ
vecāks
revīzija
5da4e43e50

+ 1
- 0
react/features/base/config/index.js Parādīt failu

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 Parādīt failu

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
 

Notiek ielāde…
Atcelt
Saglabāt