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

Allow 0, false, and null as json body #686 #800

Merged
merged 1 commit into from
May 21, 2015

Conversation

AlexDobeck
Copy link
Contributor

0, false, and null are all valid body contents of a request, however currently only an empty body is returned in these cases.

For Example:
response.json(200, true);

  • currently returns:
    200 OK
    true
  • however false doesn't return a body:
    response.json(200, false);
    200 OK

Change allows false to also return:
response.json(200, false);
200 OK
false

0, false, and null are all valid body contents of a request, however currently only an empty body is returned in these cases.

For Example:
response.json(200, true);
- currently returns:
200 OK
true

- however false doesn't return a body:
response.json(200, false);
200 OK


Change allows false to also return:
response.json(200, false);
200 OK
false
@yunong
Copy link
Member

yunong commented May 19, 2015

Hi, thanks so much for the PR. Could you please add a test case for this? Prefix the name with gh-800.

@Burnett01
Copy link

+huge support

yunong added a commit that referenced this pull request May 21, 2015
Allow 0, false, and null as json body #686
@yunong yunong merged commit cc684a4 into restify:master May 21, 2015
@AlexDobeck AlexDobeck deleted the patch-1 branch June 9, 2015 19:55
AlexDobeck added a commit to AlexDobeck/node-restify that referenced this pull request Jun 9, 2015
yunong added a commit that referenced this pull request Jun 12, 2015
Testing for issue #686 (Allow 0, false, and null as json body) #800
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.

3 participants