@sap-ux/axios-extension 1.25.2 → 1.25.4

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.
@@ -67,6 +67,11 @@ export declare class ServiceProvider extends Axios implements ServiceProviderExt
67
67
  /**
68
68
  * Create an axios configuration for a new service instance.
69
69
  *
70
+ * **IMPORTANT:**
71
+ * This method intentionally mutates Axios instance defaults.
72
+ * Changing this behaviour (e.g. making defaults immutable) will break
73
+ * Axios header merging and interceptor resolution.
74
+ *
70
75
  * @param path path of the service relative to the service provider
71
76
  * @returns axios config
72
77
  */
@@ -54,13 +54,19 @@ class ServiceProvider extends axios_1.Axios {
54
54
  /**
55
55
  * Create an axios configuration for a new service instance.
56
56
  *
57
+ * **IMPORTANT:**
58
+ * This method intentionally mutates Axios instance defaults.
59
+ * Changing this behaviour (e.g. making defaults immutable) will break
60
+ * Axios header merging and interceptor resolution.
61
+ *
57
62
  * @param path path of the service relative to the service provider
58
63
  * @returns axios config
59
64
  */
60
65
  generateServiceConfig(path) {
61
- const headers = { ...this.defaults.headers?.common, Cookie: this.cookies.toString() };
66
+ const config = Object.assign({}, this.defaults);
67
+ const headers = Object.assign(this.defaults.headers?.common ?? {}, { Cookie: this.cookies.toString() });
62
68
  return {
63
- ...this.defaults,
69
+ ...config,
64
70
  baseURL: this.defaults.baseURL + path,
65
71
  headers
66
72
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap-ux/axios-extension",
3
- "version": "1.25.2",
3
+ "version": "1.25.4",
4
4
  "description": "Extension of the Axios module adding convenience methods to interact with SAP systems especially with OData services.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -19,7 +19,7 @@
19
19
  "fast-xml-parser": "4.4.1",
20
20
  "lodash": "4.17.21",
21
21
  "open": "7.0.3",
22
- "qs": "6.11.0",
22
+ "qs": "6.14.1",
23
23
  "xpath": "0.0.33",
24
24
  "@xmldom/xmldom": "0.8.10",
25
25
  "https-proxy-agent": "7.0.5",