diff --git a/src/api/utils.js b/src/api/utils.js index 4943f650..1346a204 100644 --- a/src/api/utils.js +++ b/src/api/utils.js @@ -1,5 +1,10 @@ const isLocalhost = (instanceName) => instanceName.startsWith('localhost:') || instanceName.startsWith('127.0.0.1:') -export const baseName = (instanceName) => - isLocalhost(instanceName) ? `http://${instanceName}` : `https://${instanceName}` +export const baseName = (instanceName) => { + if (instanceName.match(/https?:\/\//)) { + return instanceName + } else { + return isLocalhost(instanceName) ? `http://${instanceName}` : `https://${instanceName}` + } +}