From e94cdf1f8e2d6ae7ac03de4386d667454eb04c8f Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 11 Jan 2021 09:38:40 +0000 Subject: [PATCH] Remove hostname check when creating API endpoint URLs now that they are proxied --- packages/client/src/api/api.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/packages/client/src/api/api.js b/packages/client/src/api/api.js index 99b085b2f..a875a6129 100644 --- a/packages/client/src/api/api.js +++ b/packages/client/src/api/api.js @@ -3,14 +3,6 @@ */ let cache = {} -/** - * Makes a fully formatted URL based on the SDK configuration. - */ -const makeFullURL = path => { - const isProxy = window.location.pathname.startsWith("/app/") - return `${isProxy ? "/app/" : "/"}${path}`.replace("//", "/") -} - /** * Handler for API errors. */ @@ -81,8 +73,7 @@ const makeCachedApiCall = async params => { */ const requestApiCall = method => async params => { const { url, cache = false } = params - const fullURL = makeFullURL(url) - const enrichedParams = { ...params, method, url: fullURL } + const enrichedParams = { ...params, method, url } return await (cache ? makeCachedApiCall : makeApiCall)(enrichedParams) }