Skip to content

Commit

Permalink
fix(tracker): Correctly extract pathname
Browse files Browse the repository at this point in the history
  • Loading branch information
aldo-roman committed Oct 11, 2023
1 parent e8da04b commit aef4b23
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/tracker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@
};
};

const getPath = url => new URL(url).pathname;
const getPath = url => {
try {
return new URL(url).pathname;
} catch (e) {
return url;
}
};

const getPayload = () => ({
website,
Expand Down

0 comments on commit aef4b23

Please sign in to comment.