Skip to content

trailing slash not working anymore #3024

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

Closed
1 task done
touletan opened this issue May 19, 2025 · 8 comments
Closed
1 task done

trailing slash not working anymore #3024

touletan opened this issue May 19, 2025 · 8 comments
Assignees
Labels
Area: Core For anything dealing with Mithril core itself

Comments

@touletan
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Mithril.js Version

2.2.3

Browser and OS

version 2.2.3
All OS/Browser

Project

No response

Code

Trailing slash stop working on version 2.2.3

Steps to Reproduce

test with http:/localhost/route and http:/localhost/route/ should go to the same page

Expected Behavior

trailing slash should not be removed from the matching route

Observed Behavior

http://localhost/#!/home and http://localhost/#!/home/ was both matching with /home route. Starting at version 2.2.3 , http://localhost/#!/home/ doesn't match to /home route anymore and is now going to default route.

Context

No response

@touletan touletan added the Area: Core For anything dealing with Mithril core itself label May 19, 2025
@touletan touletan changed the title trailing slash not working anympre trailing slash not working anymore May 19, 2025
@dead-claudia
Copy link
Member

  1. Have you tried this on the latest version?
  2. Do you have code to reproduce this?

@kfule
Copy link
Contributor

kfule commented May 20, 2025

For your reference:
#2764
#2763

@touletan
Copy link
Contributor Author

no it is not working with the latest version.
https://jsfiddle.net/ksb3L1h9/1/

@touletan
Copy link
Contributor Author

this code was in version 2.2.2, but it is not there anymore
file /pathname/parse.js
if (path.length > 1 && path[path.length - 1] === "/") path = path.slice(0, -1)

@touletan
Copy link
Contributor Author

touletan commented May 23, 2025

@dead-claudia , pull request created with a potential easy fix to this: PR3025. Hopefully this doesn't break anything.....

@dead-claudia
Copy link
Member

And merged.

@dead-claudia
Copy link
Member

And released: https://github.com/MithrilJS/mithril.js/releases/tag/v2.3.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Core For anything dealing with Mithril core itself
Projects
None yet
Development

No branches or pull requests

3 participants