undici: Invalid body doesn't error
test('https://github.com/mcollina/undici/issues/807', (t) => {
t.plan(2)
const server = net.createServer(socket => {
socket.write('HTTP/1.1 200 OK\r\n')
socket.write('Content-Length: 1\r\n\r\n')
socket.write('11111\r\n')
})
t.teardown(server.close.bind(server))
server.listen(0, () => {
const client = new Client(`http://localhost:${server.address().port}`)
t.teardown(client.destroy.bind(client))
client.request({
path: '/',
method: 'GET'
}, (err, data) => {
t.error(err)
data.body.resume().on('end', () => {
t.fail()
})
})
})
})
I think the above request should fail. The body is longer than content-length.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 26 (26 by maintainers)
Commits related to this issue
- fix: complete message error Fixes: https://github.com/nodejs/undici/issues/810 Fixes: https://github.com/nodejs/undici/issues/807 — committed to nodejs/undici by ronag 3 years ago
- fix: complete message error (#816) Fixes: https://github.com/nodejs/undici/issues/810 Fixes: https://github.com/nodejs/undici/issues/807 — committed to nodejs/undici by ronag 3 years ago
- fix: complete message error (#816) Fixes: https://github.com/nodejs/undici/issues/810 Fixes: https://github.com/nodejs/undici/issues/807 — committed to crysmags/undici by ronag 3 years ago
I haven’t forgotten and will get to this as soon as I can.
I’ve been working non stop with deploying a new system into production. I think I can have a PR by end of week.
Yea. I think you might be right. I’ll open a Pr.
I have verified and we get an error as the response from execute.