Allow alternate host url in tracker.

This commit is contained in:
Mike Cao committed 2020-08-31 20:25:31 -07:00
1 parent aec012fb79
commit cebd3fd924
3 files changed
+9 -5

No files matched your search

+2 -2
View File
@@ -1,11 +1,11 @@
export function removeTrailingSlash(url) {
return url.length > 1 && url.endsWith('/') ? url.slice(0, -1) : url;
return url && url.length > 1 && url.endsWith('/') ? url.slice(0, -1) : url;
}
export function getDomainName(str) {
try {
return new URL(str).hostname;
} catch {
} catch (e) {
return str;
}
}