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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rest-client-sdk",
3
- "version": "6.7.0",
3
+ "version": "6.7.2",
4
4
  "description": "Rest Client SDK for API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
@@ -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
- if (`/${segments[0]}` !== this.sdk.mapping.idPrefix) {
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
- const baseHeaders: HeadersInit = {
465
- 'Content-Type': 'application/json',
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}`;