Remove error log for getDomain
This commit is contained in:
4
client/lib/utils.js
vendored
4
client/lib/utils.js
vendored
@@ -61,10 +61,10 @@ export const getHost = function () {
|
|||||||
export const getDomain = function (url) {
|
export const getDomain = function (url) {
|
||||||
if (url.includes('localhost')) return 'localhost'
|
if (url.includes('localhost')) return 'localhost'
|
||||||
try {
|
try {
|
||||||
|
if (!url.startsWith('http')) url = 'https://' + url
|
||||||
return (new URL(url)).hostname
|
return (new URL(url)).hostname
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('Error extracting domai from: ',url,e)
|
return url
|
||||||
return null
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user