@opengis/fastify-table 1.1.116 → 1.1.117

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/fastify-table",
3
- "version": "1.1.116",
3
+ "version": "1.1.117",
4
4
  "type": "module",
5
5
  "description": "core-plugins",
6
6
  "main": "index.js",
@@ -1,3 +1,4 @@
1
+ import config from '../../../../config.js';
1
2
  import xssInjection from '../xssInjection.js';
2
3
 
3
4
  // RTE - rich text editor
@@ -11,9 +12,10 @@ function checkXSS({ body, schema = {} }) {
11
12
  if (stopSpecialSymbols?.length) stopSpecialSymbols?.forEach((el) => stopWords.push(el));
12
13
 
13
14
  // escape arrows on non-RTE
15
+ const skipScreening = config.skipScreening || ['Summernote', 'Tiny', 'Ace', 'Texteditor'];
14
16
  Object.keys(body)
15
17
  .filter((key) => ['<', '>'].find((el) => body[key]?.includes?.(el))
16
- && !['Summernote', 'Tiny', 'Ace', 'Texteditor'].includes(schema?.[key]?.type))
18
+ && !skipScreening.includes(schema?.[key]?.type))
17
19
  ?.forEach((key) => {
18
20
  Object.assign(body, { [key]: body[key].replace(/</g, '&lt;').replace(/>/g, '&gt;') });
19
21
  });
@@ -25,7 +27,7 @@ function checkXSS({ body, schema = {} }) {
25
27
  const disabledCheckFields = Object.keys(schema || {})?.filter((el) => schema?.[el]?.xssCheck === false); // exclude specific columns
26
28
 
27
29
  // check RTE
28
- /* const richTextFields = Object.keys(schema).filter((el) => ['Summernote', 'Tiny', 'Ace'].includes(schema[el]?.type));
30
+ /* const richTextFields = Object.keys(schema).filter((el) => skipScreening.includes(schema[el]?.type));
29
31
  richTextFields.filter((key) => !checkList.find((el) => body[key].includes(el)))?.forEach((key) => {
30
32
  disabledCheckFields.push(key);
31
33
  }); */