Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Pages filter when URL has a trailing slash #630

Merged
merged 1 commit into from
Apr 25, 2021

Conversation

Wonderfall
Copy link
Contributor

@Wonderfall Wonderfall commented Apr 18, 2021

This fixes #606 as discussed there. It's not uncommon for URLs to have a trailing slash and this format is used for instance by Ghost CMS; thus it can cause issues with the way Umami clears URLs for its filtering function (requests do not have a trailing slash so they return empty results).

Tried this (very) small change myself and everything seems fine!

EDIT: After some thinking I think it was there in the first place to prevent mixing up trail & non-trail URLs. Normally this shouldn't be an issue as it should be properly handled by the website itself (in case of Ghost, it redirects non-slash to slash).

Don't hesitate to close this PR if you think there's a better way to handle this:

  • For instance, Umami could become "slash agnostic" and return results for both slash & non-slash
  • But now it's defaulting to non-slash, which breaks page filter for some of us

@netlify
Copy link

netlify bot commented Apr 18, 2021

Deploy request for umami-dev pending review.

Review with commit 807cd5d

https://app.netlify.com/sites/umami-dev/deploys

@vercel
Copy link

vercel bot commented Apr 18, 2021

Someone is attempting to deploy a commit to a Personal Account owned by @mikecao on Vercel.

@mikecao first needs to authorize it.

@Wonderfall Wonderfall changed the title Fix Pages filter when URL has a trailing slash (fix https://github.com/mikecao/umami/issues/606) Fix Pages filter when URL has a trailing slash Apr 18, 2021
@mikecao mikecao changed the base branch from master to dev April 25, 2021 04:19
@mikecao mikecao merged commit fdbb5fc into umami-software:dev Apr 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Page filter doesn't work
2 participants