Permalink
Browse files

Merge branch 'master' of github.com:mde/geddy

* 'master' of github.com:mde/geddy:
  Posts with no content type shouldn't bomb
  • Loading branch information...
2 parents 8d377bd + d0c6578 commit 5366089a6761dc698c926dbab1e274a4717b8be1 Techwraith committed Feb 11, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/app.js
View
@@ -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();
});

0 comments on commit 5366089

Please sign in to comment.