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

search part of location is misinterpreted as fragment when root is not "/" #55

Open
dhritzkiv opened this issue Jul 25, 2017 · 0 comments
Assignees

Comments

@dhritzkiv
Copy link
Member

dhritzkiv commented Jul 25, 2017

When root isn't set to "/", I've noticed some unexpected behaviour with regard to the root url when it has a query string.

An example:

const Router = AmpersandRouter.extend({
    routes: {
        "": "index",
        "(*path)": "catchAll"
    },
    index() {
        //never fires
    },
    catchAll(path, query) {
        console.log(pathname);//path results in the query string instead
    }
});

const router = new Router();

router.history.start({
    pushState: true,
    root: "/app"
});

When starting the page at, say /app?foo=bar, path incorrectly results in "foo=bar", which isn't right. router.history.fragment also reports "foo=bar".

However, staring the page at /app/second?foo=bar, path correctly results in "/second"

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

1 participant