Debug getDomain in prod
This commit is contained in:
7
client/lib/utils.js
vendored
7
client/lib/utils.js
vendored
@@ -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'
|
||||||
return (new URL(url)).hostname
|
try {
|
||||||
|
return (new URL(url)).hostname
|
||||||
|
} catch (e) {
|
||||||
|
console.error('Error extracting domai from: ',url,e)
|
||||||
|
return null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user