Skip to content
Snippets Groups Projects
Commit 26622100 authored by vaartis's avatar vaartis
Browse files

Make baseName check if http is already in the name

parent 10d3f3f0
No related branches found
No related tags found
1 merge request!48More annoying fixes for the emoji packs
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}`
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment