Odd corner case where query string raises an error with push state disabled
nicolashery opened this issue · comments
Nicolas Hery commented
Given this code:
var Handler = {
index: function(req) {
console.log(req);
}
};
Aviator.pushStateEnabled = false;
Aviator.setRoutes({
'/users': {
target: Handler,
'/': 'index'
},
'/cats/:id': {
target: Handler,
'/': 'index'
}
});
Aviator.dispatch();
Aviator.navigate('/users?foo=bar');
I get a Uncaught TypeError: Cannot read property 'indexOf' of undefined (aviator.js:898)
.
But if I comment out the pushStateEnabled = false
, it works as expected.
Simon Højberg commented
I think i have an idea of whats going on here. Should have a fix shortly