编辑:从Express 4.x开始,您需要使用res.headersSent。
还要注意,您可能要在检查之前使用setTimeout,因为在调用res.send()之后,它不会立即设置为true。资源
简单:Connect的Response类提供一个公共属性“ headerSent”。
res.headerSent是一个布尔值,指示标头是否已经发送到客户端。
从源代码:
res.__defineGetter__('headerSent', function(){ return this._header; });https://github.com/senchalabs/connect/blob/master/lib/patch.js#L22



