@gravity-ui/gateway 2.5.0 → 2.5.1
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/README.md +5 -0
- package/build/utils/validate.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -124,6 +124,11 @@ interface GatewayConfig {
|
|
|
124
124
|
}
|
|
125
125
|
```
|
|
126
126
|
|
|
127
|
+
#### validationSchema
|
|
128
|
+
|
|
129
|
+
By default, for path params in rest actions used the following regexp: `/^((?!(\.\.|\?|#|\\|\/)).)*$/i`.
|
|
130
|
+
If the parameter value does not pass validation, the `GATEWAY_INVALID_PARAM_VALUE` value is returned.
|
|
131
|
+
|
|
127
132
|
### Usage in Node.js
|
|
128
133
|
|
|
129
134
|
Upon gateway initialization, in addition to exporting the controller, it also exports an `api` object, which represents the core for executing requests to the backend.
|
package/build/utils/validate.js
CHANGED
|
@@ -29,7 +29,7 @@ function encodePathParams(params) {
|
|
|
29
29
|
}
|
|
30
30
|
exports.encodePathParams = encodePathParams;
|
|
31
31
|
function getPathParam(value) {
|
|
32
|
-
return /^((?!(\.\.|\?|#|\\|\/)).)*$/i.test(value) ? value : '';
|
|
32
|
+
return /^((?!(\.\.|\?|#|\\|\/)).)*$/i.test(value) ? value : 'GATEWAY_INVALID_PARAM_VALUE';
|
|
33
33
|
}
|
|
34
34
|
exports.getPathParam = getPathParam;
|
|
35
35
|
function getPathArgsProxy(args, encodePathArgs) {
|