Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix "Can't set headers after they are sent" errors
This PR tries to fix "Can't set headers after they are sent" errors. That are a lot of situations where this error can occurs. In my case, it is happening because I have others middlewares (in an expressjs application that tries to proxy requests). Some of those middlewares (like [passportjs](http://passportjs.org/), or [cors](https://www.npmjs.com/package/cors)) can run ```res.end()``` and when the proxy receive a response, it is already finished. So, it is necessary to test if we can write on the user response when the proxy response is ready. I think it could also fix http-party#930, http-party#1168, http-party#908
- Loading branch information