Remove hostname check when creating API endpoint URLs now that they are proxied
This commit is contained in:
parent
ae5d970a92
commit
e94cdf1f8e
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue