Debug getDomain in prod
This commit is contained in:
parent
cf499e7274
commit
e41929e4c8
|
@ -60,7 +60,12 @@ 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 {
|
||||||
return (new URL(url)).hostname
|
return (new URL(url)).hostname
|
||||||
|
} catch (e) {
|
||||||
|
console.error('Error extracting domai from: ',url,e)
|
||||||
|
return null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue