@shopware-ag/app-server-sdk
Advanced tools
Comparing version 1.1.10 to 1.1.11
@@ -61,3 +61,3 @@ "use strict"; | ||
const f = await globalThis.fetch(`${this.shop.getShopUrl()}/api${url}`, { | ||
redirect: "error", | ||
redirect: "manual", | ||
body, | ||
@@ -69,2 +69,14 @@ headers: Object.assign({ | ||
}); | ||
if (f.status === 301 || f.status === 302) { | ||
throw new ApiClientRequestFailed(this.shop.getShopId(), new HttpClientResponse(f.status, { | ||
errors: [ | ||
{ | ||
code: "301", | ||
status: "301", | ||
title: "301", | ||
detail: "Got a redirect response from the URL, the URL should point to the Shop without redirect", | ||
}, | ||
], | ||
}, f.headers)); | ||
} | ||
// Obtain new token | ||
@@ -90,3 +102,3 @@ if (!f.ok && f.status === 401) { | ||
method: "POST", | ||
redirect: "error", | ||
redirect: "manual", | ||
headers: { | ||
@@ -101,2 +113,14 @@ "content-type": "application/json", | ||
}); | ||
if (auth.status === 301 || auth.status === 302) { | ||
throw new ApiClientRequestFailed(this.shop.getShopId(), new HttpClientResponse(auth.status, { | ||
errors: [ | ||
{ | ||
code: "301", | ||
status: "301", | ||
title: "301", | ||
detail: "Got a redirect response from the URL, the URL should point to the Shop without redirect", | ||
}, | ||
], | ||
}, auth.headers)); | ||
} | ||
if (!auth.ok) { | ||
@@ -103,0 +127,0 @@ const contentType = auth.headers.get("content-type") || "text/plain"; |
@@ -58,3 +58,3 @@ /** | ||
const f = await globalThis.fetch(`${this.shop.getShopUrl()}/api${url}`, { | ||
redirect: "error", | ||
redirect: "manual", | ||
body, | ||
@@ -66,2 +66,14 @@ headers: Object.assign({ | ||
}); | ||
if (f.status === 301 || f.status === 302) { | ||
throw new ApiClientRequestFailed(this.shop.getShopId(), new HttpClientResponse(f.status, { | ||
errors: [ | ||
{ | ||
code: "301", | ||
status: "301", | ||
title: "301", | ||
detail: "Got a redirect response from the URL, the URL should point to the Shop without redirect", | ||
}, | ||
], | ||
}, f.headers)); | ||
} | ||
// Obtain new token | ||
@@ -87,3 +99,3 @@ if (!f.ok && f.status === 401) { | ||
method: "POST", | ||
redirect: "error", | ||
redirect: "manual", | ||
headers: { | ||
@@ -98,2 +110,14 @@ "content-type": "application/json", | ||
}); | ||
if (auth.status === 301 || auth.status === 302) { | ||
throw new ApiClientRequestFailed(this.shop.getShopId(), new HttpClientResponse(auth.status, { | ||
errors: [ | ||
{ | ||
code: "301", | ||
status: "301", | ||
title: "301", | ||
detail: "Got a redirect response from the URL, the URL should point to the Shop without redirect", | ||
}, | ||
], | ||
}, auth.headers)); | ||
} | ||
if (!auth.ok) { | ||
@@ -100,0 +124,0 @@ const contentType = auth.headers.get("content-type") || "text/plain"; |
{ | ||
"name": "@shopware-ag/app-server-sdk", | ||
"version": "1.1.10", | ||
"version": "1.1.11", | ||
"description": "App Server SDK for JavaScript", | ||
@@ -5,0 +5,0 @@ "type": "module", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
509806
5361