diff --git a/lib/response-stream.js b/lib/response-stream.js index e11b2d3..bd748b7 100644 --- a/lib/response-stream.js +++ b/lib/response-stream.js @@ -47,10 +47,15 @@ var ResponseStream = module.exports = function (options) { }); if (this.response) { - this._headers = this.response._headers = this.response._headers || {}; + try { + this._headers = this.response.getHeaders() || {}; + } catch (err) { + this._headers = this.response._headers = this.response._headers || {}; + } + // Patch to node core - this.response._headerNames = this.response._headerNames || {}; + this.response._headerNames = this.response._headerNames || {}; // // Proxy to emit "header" event