Skip to content

Commit

Permalink
Add test for missing request body when using json:true
Browse files Browse the repository at this point in the history
  • Loading branch information
simov committed Sep 24, 2015
1 parent 65cb53c commit f6b91b5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test-json-request.js
Expand Up @@ -72,6 +72,16 @@ testJSONValueReviver('jsonReviver', -48269.592, function (k, v) {
}, 48269.592)
testJSONValueReviver('jsonReviverInvalid', -48269.592, 'invalid reviver', -48269.592)

tape('missing body', function (t) {
s.on('/missing-body', function (req, res) {
t.equal(req.headers['content-type'], undefined)
res.end()
})
request({url:s.url + '/missing-body', json:true}, function () {
t.end()
})
})

tape('cleanup', function(t) {
s.close(function() {
t.end()
Expand Down

0 comments on commit f6b91b5

Please sign in to comment.