Debug getDomain in prod

This commit is contained in:
Julien Nahum 2024-01-15 16:17:10 +01:00
parent cf499e7274
commit e41929e4c8
1 changed files with 6 additions and 1 deletions

7
client/lib/utils.js vendored
View File

@ -60,7 +60,12 @@ export const getHost = function () {
*/
export const getDomain = function (url) {
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
}
}
/**