piwik-react-router icon indicating copy to clipboard operation
piwik-react-router copied to clipboard

`PiwikTracker.track` sends URLs with appended slash

Open ingmarh opened this issue 6 years ago • 1 comments

url-join had a bug, leading to an additional "/" that was appended to the URL send with PiwikTracker.track.

# with url-join 1.1.0
$ node -pe "require('url-join')('/path', '')"
/path/
$ node -pe "require('url-join')('/', '')"
//

# with url-join 4.0.0
$ node -pe "require('url-join')('/path', '')"
/path
$ node -pe "require('url-join')('/', '')"

Piwik React Router has url-join currently locked at version ^1.1.0, so an update should fix this.

Is there a specific reason why urljoin(loc.pathname, loc.search) is used instead of loc.pathname + loc.search?

ingmarh avatar Feb 09 '18 17:02 ingmarh

I noticed the same, updating url-join dependency will solve this. Hoping the fix will be merged into the main branch.

bitconym avatar Oct 24 '18 17:10 bitconym