Skip to content

Commit

Permalink
Merge pull request #16 from pitpit/feature/parse-body-of-all-json-req…
Browse files Browse the repository at this point in the history
…uests

A json request can have a body.
  • Loading branch information
Marco Pracucci committed Nov 14, 2018
2 parents 6e04f8f + 00fb4de commit 610d2d7
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,6 @@ function Server(host, port, key, cert)
}

function _json(req, res, next) {
if (req.method !== 'POST' && req.method !== 'PUT' && req.method !== 'PATCH') {
return next();
}

if ('application/json' !== req.headers['content-type']) {
return next();
}

bodyParser.json()(req, res, next)
}

Expand Down

0 comments on commit 610d2d7

Please sign in to comment.