From 6e8faa702bc09ffa2606481191812765bfa55ad6 Mon Sep 17 00:00:00 2001 From: Paul Hill Date: Wed, 3 Jul 2013 10:21:15 -0700 Subject: [PATCH] Fixing hasBody check that didn't work when content-length was not defined. --- lib/utils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/utils.js b/lib/utils.js index 74bcdbf3b..d3fb7e9ce 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -29,7 +29,8 @@ exports.brokenPause = parseInt(nodeVersion[0], 10) === 0 exports.hasBody = function(req) { return 'transfer-encoding' in req.headers - || req.headers["content-length"] !== '0'; + || ('content-length' in req.headers && req.headers["content-length"] !== '0') + || 'content-type' in req.headers; }; /**