Skip to content

Changed deprecated res.send(status) to res.sendStatus(status) #1912

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

Merged

Conversation

emadehsan
Copy link
Contributor

foreverJs was logging this

express deprecated res.send(status): Use res.sendStatus(status) instead at node_modules/parse-server/lib/middlewares.js:156:9

@codecov-io
Copy link

Current coverage is 91.94%

Merging #1912 into master will increase coverage by <.01%

  1. 2 files (not in diff) in src were modified. more
    • Misses +2
    • Hits +101
@@             master      #1912   diff @@
==========================================
  Files            91         91          
  Lines          6385       6488   +103   
  Methods        1111       1139    +28   
  Messages          0          0          
  Branches       1337       1372    +35   
==========================================
+ Hits           5864       5965   +101   
- Misses          521        523     +2   
  Partials          0          0          

Powered by Codecov. Last updated by 0850c18...ac0166b

@TylerBrock
Copy link
Contributor

Hey, thanks for contributing.

To my knowledge res.send(<statusCode>) isn't deprecated as it does something slightly different than res.sendStatus(<statusCode>). sendStatus responds with the status code and also with a body having a description of said code. From the express 4 docs:

res.sendStatus(200); // equivalent to res.status(200).send('OK')
res.sendStatus(403); // equivalent to res.status(403).send('Forbidden')
res.sendStatus(404); // equivalent to res.status(404).send('Not Found')
res.sendStatus(500); // equivalent to res.status(500).send('Internal Server Error')

Then I read this and it seems like you are entirely right.

@TylerBrock TylerBrock merged commit 7d2929a into parse-community:master May 28, 2016
@emadehsan emadehsan deleted the res_send_int__deprecated branch May 29, 2016 17:52
@emadehsan emadehsan restored the res_send_int__deprecated branch May 29, 2016 17:53
@emadehsan emadehsan deleted the res_send_int__deprecated branch May 29, 2016 17:54
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