rest-client-sdk 6.7.0 → 6.7.2
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/dist/index.es.js +8 -4
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +8 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/client/AbstractClient.ts +8 -4
package/package.json
CHANGED
|
@@ -320,7 +320,8 @@ class AbstractClient<D extends MetadataDefinition> {
|
|
|
320
320
|
|
|
321
321
|
if (this.sdk.mapping.idPrefix) {
|
|
322
322
|
const segments = url.segment();
|
|
323
|
-
|
|
323
|
+
|
|
324
|
+
if (!url.pathname().startsWith(this.sdk.mapping.idPrefix)) {
|
|
324
325
|
segments.unshift(this.sdk.mapping.idPrefix);
|
|
325
326
|
url.segment(segments);
|
|
326
327
|
}
|
|
@@ -460,10 +461,13 @@ class AbstractClient<D extends MetadataDefinition> {
|
|
|
460
461
|
requestParams: RequestInit
|
|
461
462
|
): Promise<Response> {
|
|
462
463
|
let params = requestParams;
|
|
464
|
+
let baseHeaders: HeadersInit = {};
|
|
463
465
|
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
466
|
+
if (params.method !== 'GET' || (params.method !== 'GET' && params.method !== 'DELETE')) {
|
|
467
|
+
baseHeaders = {
|
|
468
|
+
'Content-Type': 'application/json',
|
|
469
|
+
};
|
|
470
|
+
}
|
|
467
471
|
|
|
468
472
|
if (accessToken) {
|
|
469
473
|
baseHeaders.Authorization = `${this.sdk.config.authorizationType} ${accessToken}`;
|