@sitecore-cloudsdk/core
Advanced tools
Comparing version 0.1.2 to 0.1.3
{ | ||
"name": "@sitecore-cloudsdk/core", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"license": "Apache-2.0", | ||
@@ -5,0 +5,0 @@ "main": "dist/cjs/src/index.js", |
@@ -21,8 +21,8 @@ "use strict"; | ||
const url = (0, construct_get_browser_id_url_1.constructGetBrowserIdUrl)(sitecoreEdgeUrl, sitecoreEdgeContextId); | ||
let response; | ||
let payload; | ||
if (timeout !== undefined) { | ||
response = await (0, utils_1.fetchWithTimeout)(url, timeout, fetchOptions); | ||
payload = await (0, utils_1.fetchWithTimeout)(url, timeout, fetchOptions); | ||
} | ||
else { | ||
response = await fetch(url, fetchOptions) | ||
payload = await fetch(url, fetchOptions) | ||
.then((res) => res.json()) | ||
@@ -32,7 +32,7 @@ .then((data) => data) | ||
} | ||
if (!response) | ||
if (!payload?.ref) | ||
throw new Error('[IE-0003] Unable to set the cookie because the browser ID could not be retrieved from the server. Try again later, or use try-catch blocks to handle this error.'); | ||
const { ref: browserId } = response; | ||
const { ref: browserId } = payload; | ||
return { browserId }; | ||
} | ||
exports.fetchBrowserIdFromEdgeProxy = fetchBrowserIdFromEdgeProxy; |
{ | ||
"name": "@sitecore-cloudsdk/core", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"license": "Apache-2.0", | ||
@@ -5,0 +5,0 @@ "main": "dist/cjs/src/index.js", |
@@ -18,8 +18,8 @@ // © Sitecore Corporation A/S. All rights reserved. Sitecore® is a registered trademark of Sitecore Corporation A/S. | ||
const url = constructGetBrowserIdUrl(sitecoreEdgeUrl, sitecoreEdgeContextId); | ||
let response; | ||
let payload; | ||
if (timeout !== undefined) { | ||
response = await fetchWithTimeout(url, timeout, fetchOptions); | ||
payload = await fetchWithTimeout(url, timeout, fetchOptions); | ||
} | ||
else { | ||
response = await fetch(url, fetchOptions) | ||
payload = await fetch(url, fetchOptions) | ||
.then((res) => res.json()) | ||
@@ -29,6 +29,6 @@ .then((data) => data) | ||
} | ||
if (!response) | ||
if (!payload?.ref) | ||
throw new Error('[IE-0003] Unable to set the cookie because the browser ID could not be retrieved from the server. Try again later, or use try-catch blocks to handle this error.'); | ||
const { ref: browserId } = response; | ||
const { ref: browserId } = payload; | ||
return { browserId }; | ||
} |
{ | ||
"name": "@sitecore-cloudsdk/core", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"license": "Apache-2.0", | ||
@@ -5,0 +5,0 @@ "main": "dist/cjs/src/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet