Skip to content

Commit

Permalink
fix: improve full path matching of a path with query params
Browse files Browse the repository at this point in the history
  • Loading branch information
troch committed Jan 6, 2016
1 parent 154b170 commit ada3897
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions modules/Path.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,7 @@ export default class Path {
// trailingSlash: falsy => non optional, truthy => optional
const source = optTrailingSlash(this.source, trailingSlash);
// Check if exact match
const matched = this._urlMatch(path, new RegExp('^' + source + (this.hasQueryParams ? '\\?.*$' : '$')));

const matched = this._urlMatch(path, new RegExp('^' + source + (this.hasQueryParams ? '(\\?.*$|$)' : '$')));
// If no match, or no query params, no need to go further
if (!matched || !this.hasQueryParams) return matched;
// Extract query params
Expand Down

0 comments on commit ada3897

Please sign in to comment.