Skip to content

Commit

Permalink
Handle the prefixed paths in the path method
Browse files Browse the repository at this point in the history
  • Loading branch information
mquandalle committed Oct 3, 2015
1 parent bbba4e3 commit 875b4f7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,11 @@ Router.prototype.path = function(pathDef, fields, queryParams) {
return encodeURIComponent(encodeURIComponent(fields[key] || ""));
});

path = path.replace(/\/\/+/g, "/"); // Replace multiple slashes with single slash
// Prefix the path with the router global prefix
path = this._basePath + path;

// Replace multiple slashes with single slash
path = path.replace(/\/\/+/g, "/");

// remove trailing slash
// but keep the root slash if it's the only one
Expand Down

0 comments on commit 875b4f7

Please sign in to comment.