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

Page sometimes appending an additional slash? #332

Closed
quirkles opened this issue Nov 10, 2015 · 8 comments
Closed

Page sometimes appending an additional slash? #332

quirkles opened this issue Nov 10, 2015 · 8 comments

Comments

@quirkles
Copy link

Hi, so my routing setup looks like this:

    page('/login', function () {
      // render the login page
      console.log(page.current);
    });
    page('/home', function () {
      // render my home page
      console.log(page.current);
    });
    page('*', function () {
      console.log(page.current);
      // catchall
    });
    page.start({
      hashbang: true
    });

If I use page('/home') in my code, no problems

if i just enter http://mysite.com/#!/home then i hit the catchall callback and the value of page.current is '//home' with two slashes, if i just hit enter in the address bar again then it hits the '/home' callback, as expected.

So what gives? what am I doing wrong

@farzher
Copy link

farzher commented Dec 19, 2015

+1

When editing the URL manually from the browser, it breaks in the same way for me too.

@dashed
Copy link

dashed commented Dec 22, 2015

I'm running into the same issue. Looks like this PR fixes this: #322

@farzher
Copy link

farzher commented Dec 22, 2015

I stopped using hashbang, it's too buggy. There's an issue about removing it #229
I just use page.base('/#') instead (personally I don't even want the bang anyway)

@quirkles
Copy link
Author

Interesting, yeah I implemented my own work around where I catch 404's and see if they are equal to '/' plus an existing route. Very ugly but Necessary until this gets fixed.

@dashed
Copy link

dashed commented Dec 22, 2015

@farzher ah sweet. page.base('/#') seems to good workaround. Thanks.

@quirkles
Copy link
Author

Gonna try that too.

@farzher
Copy link

farzher commented Dec 22, 2015

You could even put page.base('/#!') if you really wanted :)

@matthewp
Copy link
Collaborator

I believe this has been fixed by a recent version. I was unable to create it upon trying. Please try yourself using 1.8.0 and let me know if it's still an issue. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants