until node does.
res.__defineGetter__('headerSent', function(){
return this._header;
});
Proxy to emit "header" event.
res._renderHeaders = function(){
if (!this._emittedHeader) this.emit('header');
this._emittedHeader = true;
return _renderHeaders.call(this);
};
res.writeHead = function(statusCode, reasonPhrase, headers){
if (typeof reasonPhrase === 'object') headers = reasonPhrase;
if (typeof headers === 'object') {
Object.keys(headers).forEach(function(key){
this.setHeader(key, headers[key]);
}, this);
}
if (!this._emittedHeader) this.emit('header');
this._emittedHeader = true;
return writeHead.call(this, statusCode, reasonPhrase);
};
res._hasConnectPatch = true;
}
res.setHeader()
Set header
field
toval
, special-casingthe
Set-Cookie
field for multiple support.Source