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
Versioned route matching throws TypeError when "maxV" is not set #1380
Comments
Hey @kusor! Thank you for opening a thorough bug report and an accompanying PR! I'm tagging this as an unverified bug until a maintainer (probably me 😉) runs the repro case. ❤️ |
@retrohacker thanks for taking a look! |
Reproduced locally |
Closed by #1381 |
trentm
added a commit
to TritonDataCenter/manta-muskie
that referenced
this issue
Apr 15, 2020
…2999 (#62) Upgrade to restify 6.x to get the fix for restify/node-restify#1380 which breaks restify API versioning in restify 4.x. Co-authored-by: Trent Mick <trentm@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Report
When we have two routes applicable to the same request, one typed and the other versioned and not typed, a TypeError exception is thrown.
Restify Version
Every one since
v2.8.5
, exactly since commit Route matching should only prefer later routes if version is greaterNode.js Version
Any.
Expected behaviour
Exceptions should not be thrown
Actual behaviour
Repro case
Cause
The bug problem is into version checking here: https://github.com/restify/node-restify/blob/5.x/lib/router.js#L506-L519.
The first time we hit
semver.gt(v, maxV)
, the value formaxV
isundefined
.Are you willing and able to fix this?
Yes
The text was updated successfully, but these errors were encountered: