Merge pull request #2337 from aldo-roman/master

fix(tracker): Correctly extract pathname
This commit is contained in:
Mike Cao 2023-10-11 19:28:22 -10:00 committed by GitHub
commit eae470c374
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,10 +43,11 @@
};
const getPath = url => {
if (url.substring(0, 4) === 'http') {
return '/' + url.split('/').splice(3).join('/');
}
try {
return new URL(url).pathname;
} catch (e) {
return url;
}
};
const getPayload = () => ({