joernroeder / piwik-react-router

Piwik analytics component for react-router
https://www.npmjs.org/package/piwik-react-router
MIT License
61 stars 22 forks source link

`PiwikTracker.track` sends URLs with appended slash #51

Open ingmarh opened 6 years ago

ingmarh commented 6 years ago

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?

bitconym commented 5 years ago

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