Skip to content

Commit

Permalink
Posts with no content type shouldn't bomb
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Ihbe committed Feb 10, 2012
1 parent 29e86f7 commit d0c6578
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,9 @@ var App = function () {
// If it's a plain form-post, save the request-body, and parse it into
// params as well
if ((req.method == 'POST' || req.method == 'PUT') &&
(req.headers['content-type'].indexOf('form-urlencoded') > -1 ||
req.headers['content-type'].indexOf('application/json') > -1)) {
(req.headers['content-type'] &&
(req.headers['content-type'].indexOf('form-urlencoded') > -1 ||
req.headers['content-type'].indexOf('application/json') > -1))) {
req.addListener('data', function (data) {
body += data.toString();
});
Expand Down

0 comments on commit d0c6578

Please sign in to comment.