-
Notifications
You must be signed in to change notification settings - Fork 34
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
breaking: support parsing of valid falsy json #183
base: master
Are you sure you want to change the base?
Conversation
// --- Tests | ||
|
||
describe('restify-client tests', function () { | ||
|
||
before(function (callback) { | ||
try { | ||
SERVER = restify.createServer({ | ||
dtrace: dtrace, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7.x no longer takes dtrace as a function, it's now a boolean. Removed as it wasn't super important for the client tests.
Is that really a regression, it seems that the erroneous behavior may have been present for a while. For instance, the commit at fb52f48#diff-1f5c7c63b7ce8433f5b0480296a5f265R57 uses:
to set the response object. Wouldn't that have the same problem? If so, that commit was merged ~2015, wouldn't that make this PR semver major? |
@misterdjules You're right - I confused this with restify's ability to send these values as strings (but not for restify-client's ability to parse those strings as valid JSON). I guess this is indeed semver major. |
As part of revving dependencies, I discovered a regression in JSONClient. I'm not sure when it happened, it looks like the tests were not even checking for the right thing.
Essentially, if the server sends 0, null, or false, that is valid JSON and the client should respect it. This is similar to restify/node-restify#1609.