visionmedia / page.js

Micro client-side router inspired by the Express router
http://visionmedia.github.com/page.js
7.67k stars 687 forks source link

fix: don't fail on routes that begin with the page base setting #546

Open andyburke opened 4 years ago

andyburke commented 4 years ago

This resolves an issue where if you set the base to something that matches the beginning of one of your routes, things will not work properly. Eg:

page.base( '/en' ); // set to english localization

If you have a route like '/enroll', this will cause errors.

This change fixes the issue.

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 92.531% when pulling 35e8c5f8ccea7700980c3057c45f668d3e76284a on andyburke-forks:base_fix into 0d7e127037abd021fa299e2d8d0a4b727476712f on visionmedia:master.

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 92.531% when pulling 05a745da9a9201d45c8613eb6b0742959b51359b on andyburke-forks:base_fix into 0d7e127037abd021fa299e2d8d0a4b727476712f on visionmedia:master.

matthewp commented 4 years ago

Thanks for adding a test!

It looks like compiling made a whole bunch of changes that were related to your change. Why is that?

andyburke commented 4 years ago

I honestly don't know. I just tried re-running npm install to see if I somehow have a different version of whatever libraries are used to compile, but I don't think I do.

Is there a way you could pull the branch and try to build and see if the same thing is happening?

matthewp commented 4 years ago

Yeah I can do that, probably not until this weekend though.

andyburke commented 4 years ago

Any update on this?