1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.defaultDisallowedKeys = exports.filterCustomRequestConfig = void 0;
|
4 | var util_1 = require("@sap-cloud-sdk/util");
|
5 | var logger = (0, util_1.createLogger)({
|
6 | package: 'core',
|
7 | messageContext: 'http-request-config'
|
8 | });
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | function filterCustomRequestConfig(customRequestConfig, disallowedKeys) {
|
16 | if (disallowedKeys === void 0) { disallowedKeys = exports.defaultDisallowedKeys; }
|
17 | var removedKeys = Object.keys(customRequestConfig).filter(function (key) {
|
18 | return disallowedKeys.includes(key);
|
19 | });
|
20 | if (removedKeys.length) {
|
21 | logger.warn("The following keys are found in the custom request config that will be removed: ".concat(removedKeys.join(', ')));
|
22 | }
|
23 | return (0, util_1.exclude)(disallowedKeys, customRequestConfig);
|
24 | }
|
25 | exports.filterCustomRequestConfig = filterCustomRequestConfig;
|
26 |
|
27 |
|
28 |
|
29 | exports.defaultDisallowedKeys = [
|
30 | 'method',
|
31 | 'url',
|
32 | 'baseURL',
|
33 | 'data',
|
34 | 'headers',
|
35 | 'params'
|
36 | ];
|
37 |
|
\ | No newline at end of file |