Skip to content

Commit

Permalink
Merge pull request #2337 from aldo-roman/master
Browse files Browse the repository at this point in the history
fix(tracker): Correctly extract pathname
  • Loading branch information
mikecao authored Oct 12, 2023
2 parents 5f73e4e + aef4b23 commit eae470c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/tracker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
return url;
};

const getPayload = () => ({
Expand Down

0 comments on commit eae470c

Please sign in to comment.