Skip to content

Commit

Permalink
Use RegExp instead of pattern for app route
Browse files Browse the repository at this point in the history
Use RegExp instead of pattern for app route, because Crossroads.js
extracts the query string as part of the rest segment. This is because
it does not support having both segments as optional.
See: millermedeiros/crossroads.js#130
  • Loading branch information
guillegr123 committed Jun 5, 2022
1 parent f2cf46c commit a2db66d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/lib/monster.routing.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ define(function(require) {
},

addDefaultRoutes: function() {
this.add('apps/{appName}/:rest*::?query:', function(appName, _rest, query) {
this.add(/^apps\/([^/?]+)(?:\/[^?]*)?(\??.*)?$/, function(appName, query) {
// not logged in, do nothing to preserve potentially valid route to load after successful login
if (!monster.util.isLoggedIn()) {
return;
Expand Down

0 comments on commit a2db66d

Please sign in to comment.