Browse Source

Only check if opts.body exists and doesn't have a falsy value

master
Leo Lamprecht 8 years ago
parent
commit
e9a95e7253
No known key found for this signature in database GPG Key ID: EF804E3FF4BBA8AB
  1. 2
      lib/agent.js

2
lib/agent.js

@ -65,7 +65,7 @@ export default class Agent {
opts.body = JSON.stringify(body)
}
if (opts.body !== null && typeof body.pipe !== 'function') {
if (opts.body && typeof body.pipe !== 'function') {
opts.headers['Content-Length'] = Buffer.byteLength(opts.body)
}

Loading…
Cancel
Save