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

Route matching should only prefer later routes if version is greater #570

Merged
merged 2 commits into from
Apr 17, 2014
Merged

Route matching should only prefer later routes if version is greater #570

merged 2 commits into from
Apr 17, 2014

Conversation

brycekahle
Copy link

The previous logic would prefer a later route if the max version
satisfying the request was greater than ANY version of the previously
matched route. This fixes the logic to only compare the max version
satisfying the request of previous candidates.

The previous logic would prefer a later route if the max version
satisfying the request was greater than ANY version of the previously
matched route. This fixes the logic to only compare the max version
satisfying the request of previous candidates.
@@ -363,17 +363,16 @@ Router.prototype.find = function find(req, res, callback) {
}

if (versioned) {
var maxV;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the point of this variable? in line375 a value is assigned to it, but for what? the code never uses it afterwards.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is used on line 372

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry :/ the git diff confused me :)

@gergelyke
Copy link
Member

it looks fine, thanks for the contrib! we are releasing a version today/tomorrow, so it will be released next time!

gergelyke added a commit that referenced this pull request Apr 17, 2014
Route matching should only prefer later routes if version is greater
@gergelyke gergelyke merged commit c0428ad into restify:master Apr 17, 2014
gergelyke pushed a commit that referenced this pull request Apr 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants