Allow alternate host url in tracker.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user