Skip to content

Commit

Permalink
Merge pull request #4 from joaquimserafim/v3.0.1
Browse files Browse the repository at this point in the history
fix request body
  • Loading branch information
joaquimserafim authored Mar 1, 2017
2 parents e8b6a63 + 114a5a6 commit 9255655
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function reqSerializer (req) {
url: req.url,
qs: objectSize(req.qs) ? req.qs : undefined,
path: req.url && url.parse(req.url).pathname,
body: req._data && req._data.msg,
body: req._data,
headers: req.header
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "superagent-bunyan",
"version": "3.0.0",
"version": "3.0.1",
"description": "a plugin for superagent that uses bunyan to log the request s and responses",
"main": "index.js",
"files": [
Expand Down
4 changes: 2 additions & 2 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ describe('superagent-bunyan', () => {
expect(log1.req.method).to.be.equal('POST')
expect(log1.req.url).to.be
.equal('http://localhost:3000')
expect(log1.req.body).to.be
.equal('More human than human is our motto')
expect(log1.req.body).to.be.deep
.equal({msg: 'More human than human is our motto'})
expect(log2.err).to.not.exist
expect(log2.res).to.be.an('object')
expect(log2.res.statusCode).to.be.equal(200)
Expand Down

0 comments on commit 9255655

Please sign in to comment.