mafintosh / turbo-http

Blazing fast low level http server
MIT License
1k stars 47 forks source link

Fixes - Should not allow setHeader after Header sent #21

Closed santoshrajan closed 5 years ago

santoshrajan commented 6 years ago

This should throw.

const turbo = require('./')

const hello = Buffer.from('hello world\n')

turbo.createServer(function (req, res) {
  res.setHeader('Content-Length', hello.length)
  res.write(hello)
  res.setHeader('hello', 'world') // This should throw
}).listen(8080)
IonelLupu commented 5 years ago

@mafintosh This would be great if merged

mafintosh commented 5 years ago

0.3.2 - Thanks!