light-my-request
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -81,3 +81,3 @@ 'use strict' | ||
const payload = Buffer.concat(chunks) | ||
this.headers['content-length'] = this.headers['content-length'] || payload.length | ||
this.headers['content-length'] = this.headers['content-length'] || ('' + payload.length) | ||
this._lightMyRequest.payload = payload | ||
@@ -84,0 +84,0 @@ return next() |
{ | ||
"name": "light-my-request", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Fake HTTP injection library", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -478,2 +478,12 @@ 'use strict' | ||
test('can override stream payload content-length header without request content-length', (t) => { | ||
t.plan(1) | ||
const dispatch = function (req, res) { | ||
res.writeHead(200, { 'Content-Type': 'text/plain' }) | ||
t.equal(req.headers['content-length'], '2') | ||
} | ||
inject(dispatch, { method: 'post', url: '/', payload: getTestStream() }, () => {}) | ||
}) | ||
test('writeHead returns single buffer payload', (t) => { | ||
@@ -480,0 +490,0 @@ t.plan(3) |
Sorry, the diff of this file is not supported yet
34344
891