{"action":"created","issue":{"url":"https://api.github.com/repos/balderdashy/sails/issues/3803","repository_url":"https://api.github.com/repos/balderdashy/sails","labels_url":"https://api.github.com/repos/balderdashy/sails/issues/3803/labels{/name}","comments_url":"https://api.github.com/repos/balderdashy/sails/issues/3803/comments","events_url":"https://api.github.com/repos/balderdashy/sails/issues/3803/events","html_url":"https://github.com/balderdashy/sails/issues/3803","id":169445496,"number":3803,"title":"On POST requests, req.body is undefined in 0.12.4 while in 0.12.3 it existed as an empty object","user":{"login":"luislobo","id":453120,"avatar_url":"https://avatars.githubusercontent.com/u/453120?v=3","gravatar_id":"","url":"https://api.github.com/users/luislobo","html_url":"https://github.com/luislobo","followers_url":"https://api.github.com/users/luislobo/followers","following_url":"https://api.github.com/users/luislobo/following{/other_user}","gists_url":"https://api.github.com/users/luislobo/gists{/gist_id}","starred_url":"https://api.github.com/users/luislobo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luislobo/subscriptions","organizations_url":"https://api.github.com/users/luislobo/orgs","repos_url":"https://api.github.com/users/luislobo/repos","events_url":"https://api.github.com/users/luislobo/events{/privacy}","received_events_url":"https://api.github.com/users/luislobo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/balderdashy/sails/labels/bug","name":"bug","color":"b11420"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-08-04T18:45:16Z","updated_at":"2016-08-04T19:10:43Z","closed_at":"2016-08-04T19:10:43Z","body":"<!--\r\n======================================================\r\nHELLO, and welcome to the (experimental) Sailsbot\r\nissue-submission system.  If you encounter any\r\nproblems with this system, please contact\r\nsgress454@treeline.io\r\n\r\nFIRST THINGS FIRST: before posting, please carefully \r\nread the contribution guide (http://bit.ly/sails-issue-guide), \r\nparticularly if this is a security issue or an issue of a \r\nnon-technical nature (Github org issues, code of conduct\r\nissues, etc.).  Those should be sent directly to inquiries@treeline.io.\r\n\r\nNOW THEN: please fill out the following info \r\n(Don't change text between **) \r\n======================================================\r\n### BEGIN VERSION INFO ###\r\n-->\r\n\r\n**Sails version**: 0.12.4\r\n**Node version**: 4.4.5\r\n**NPM version**:  3.10.3\r\n**Operating system**: Linux 4.4.0-31-generic #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux\r\n\r\n\r\n<!-- \r\n### END VERSION INFO ###\r\n======================================================\r\nGREAT! - Now read carefully \r\n(Sailsbot will know if you don't)!  \r\n======================================================\r\n\r\nBefore you submit an issue for Sails, please make sure you have read the issue contribution guide (http://bit.ly/sails-issue-guide) carefully, and then verify the following by typing an X in between each set of [ ] brackets below (don't make any other changes to the text!):\r\n\r\n### BEGIN PLEDGE ###\r\n- [X] I am experiencing a concrete technical issue (aka a bug) with Sails (ideas and feature proposals should follow the guide for proposing features and enhancements (http://bit.ly/sails-feature-guide), which involves making a pull request).  If you're not 100% certain whether it's a bug or not, that's okay--you may continue.  The worst that can happen is that the issue will be closed and we'll point you in the right direction.\r\n\r\n- [X] I am not asking a question about how to use Sails or about whether or not Sails has a certain feature (please refer to the documentation(http://sailsjs.org), or post on http://stackoverflow.com, our Google Group (http://bit.ly/sails-google-group) or our live chat (https://gitter.im/balderdashy/sails).\r\n\r\n- [X] I have already searched for related issues, and found none open (if you found a related _closed_ issue, please link to it in your post).\r\n\r\n- [X] My issue title is concise, on-topic and polite (\"jst.js being removed from layout.ejs on lift\" is good; \"templates dont work\" or \"why is sails dumb\" are not so good).\r\n\r\n- [X] I have tried all the following (if relevant) and my issue remains:\r\n  - Make sure you have the right app lifted.\r\n  - Make sure you've killed the Sails server with CTRL+C and started it again.\r\n  - Make sure you closed any open browser tabs pointed at localhost before starting Sails.\r\n  - Make sure you do not have any other Sails apps running in other terminal windows.\r\n  - Make sure the app you are using to reproduce the issue has a clean node_modules/ directory, meaning:\r\n    * no dependencies are linked (e.g. you haven't run npm link foo)\r\n    * that you haven't made any inline changes to files in the node_modules/ folder\r\n    * that you don't have any weird global dependency loops. The easiest way to double-check any of the above, if you aren't sure, is to run: rm -rf node_modules && npm cache clear && npm install.\r\n\r\nand finally...\r\n- [X] **I can provide steps to reproduce this issue that others can follow.**\r\n\r\nIdeally, this involves creating a new repo that demonstrates the problem (see instructions at http://bit.ly/sails-issue-repro).  Even though your issue may seem so simple to reproduce that a new repo is unnecessary, you'd be surprised how many solutions present themselves when you start from `sails new` and attempt to recreate your issue from scratch in a new app.  This ensures that the real issue isn't in your user code (a forgotten policy file, perhaps?) or in a third-party module.  If you're absolutely _convinced_ that a new repo is unnecessary, provide clear, concise and _specific_ steps to reproduce the problem in your post (not \"create a model then do blueprint create\").\r\n### END PLEDGE ###\r\n\r\nOKAY--THANKS FOR READING!  Continue posting details of your issue below. -->\r\n<hr/>\r\nIn Sails 0.12.4, on post requests, req.body is undefined, if no body is sent.\r\nIn Sails 0.12.3, on post requests, req.body is {}, if no body is sent.\r\nSteps to reproduce.\r\nClone https://github.com/luislobo/sails-body-error\r\nstart sails\r\nIssue:\r\n```bash\r\ncurl http://localhost:1337/body/test --data ''\r\n```\r\n\r\nYou get:\r\n```\r\nundefined\r\nerror: Sending 500 (\"Server Error\") response: \r\n TypeError: Cannot read property 'shouldFail' of undefined\r\n    at Object.module.exports.test (/home/lobo/dev/luislobo/sails-body-error/api/controllers/BodyController.js:11:29)\r\n    at wrapper (/home/lobo/dev/luislobo/sails-body-error/node_modules/sails/node_modules/lodash/index.js:3095:19)\r\n    at routeTargetFnWrapper (/home/lobo/dev/luislobo/sails-body-error/node_modules/sails/lib/router/bind.js:181:5)\r\n    at callbacks (/home/lobo/dev/luislobo/sails-body-error/node_modules/express/lib/router/index.js:164:37)\r\n    at param (/home/lobo/dev/luislobo/sails-body-error/node_modules/express/lib/router/index.js:138:11)\r\n    at param (/home/lobo/dev/luislobo/sails-body-error/node_modules/express/lib/router/index.js:135:11)\r\n    at pass (/home/lobo/dev/luislobo/sails-body-error/node_modules/express/lib/router/index.js:145:5)\r\n    at nextRoute (/home/lobo/dev/luislobo/sails-body-error/node_modules/express/lib/router/index.js:100:7)\r\n    at callbacks (/home/lobo/dev/luislobo/sails-body-error/node_modules/express/lib/router/index.js:167:11)\r\n    at alwaysAllow (/home/lobo/dev/luislobo/sails-body-error/node_modules/sails/lib/hooks/policies/index.js:224:11)\r\n    at routeTargetFnWrapper (/home/lobo/dev/luislobo/sails-body-error/node_modules/sails/lib/router/bind.js:181:5)\r\n    at callbacks (/home/lobo/dev/luislobo/sails-body-error/node_modules/express/lib/router/index.js:164:37)\r\n    at param (/home/lobo/dev/luislobo/sails-body-error/node_modules/express/lib/router/index.js:138:11)\r\n    at param (/home/lobo/dev/luislobo/sails-body-error/node_modules/express/lib/router/index.js:135:11)\r\n    at pass (/home/lobo/dev/luislobo/sails-body-error/node_modules/express/lib/router/index.js:145:5)\r\n    at nextRoute (/home/lobo/dev/luislobo/sails-body-error/node_modules/express/lib/router/index.js:100:7)\r\n    at callbacks (/home/lobo/dev/luislobo/sails-body-error/node_modules/express/lib/router/index.js:167:11)\r\n    at module.exports (/home/lobo/dev/luislobo/sails-body-error/node_modules/sails/lib/hooks/cors/clear-headers.js:14:3)\r\n    at routeTargetFnWrapper (/home/lobo/dev/luislobo/sails-body-error/node_modules/sails/lib/router/bind.js:181:5)\r\n    at callbacks (/home/lobo/dev/luislobo/sails-body-error/node_modules/express/lib/router/index.js:164:37)\r\n    at param (/home/lobo/dev/luislobo/sails-body-error/node_modules/express/lib/router/index.js:138:11)\r\n    at pass (/home/lobo/dev/luislobo/sails-body-error/node_modules/express/lib/router/index.js:145:5)\r\n```\r\n\r\nStop Sails.\r\n\r\nNow do:\r\n```bash\r\nnpm install sails@0.12.3\r\n```\r\n\r\nStart sails\r\n\r\nCurl to the same endpoint\r\n\r\nNow you get:\r\n```\r\n{}\r\nundefined\r\n```"},"comment":{"url":"https://api.github.com/repos/balderdashy/sails/issues/comments/237653314","html_url":"https://github.com/balderdashy/sails/issues/3803#issuecomment-237653314","issue_url":"https://api.github.com/repos/balderdashy/sails/issues/3803","id":237653314,"user":{"login":"sgress454","id":553428,"avatar_url":"https://avatars.githubusercontent.com/u/553428?v=3","gravatar_id":"","url":"https://api.github.com/users/sgress454","html_url":"https://github.com/sgress454","followers_url":"https://api.github.com/users/sgress454/followers","following_url":"https://api.github.com/users/sgress454/following{/other_user}","gists_url":"https://api.github.com/users/sgress454/gists{/gist_id}","starred_url":"https://api.github.com/users/sgress454/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgress454/subscriptions","organizations_url":"https://api.github.com/users/sgress454/orgs","repos_url":"https://api.github.com/users/sgress454/repos","events_url":"https://api.github.com/users/sgress454/events{/privacy}","received_events_url":"https://api.github.com/users/sgress454/received_events","type":"User","site_admin":false},"created_at":"2016-08-04T19:10:43Z","updated_at":"2016-08-04T19:10:43Z","body":"Ok, all set.  Published as 0.6.4 and added a test for empty-body handling.  Thanks @luislobo!"}}
{"actor":{"display_login":"sgress454"}}