Permalink
Browse files

response: use _renderHeaders from ServerResponse

fix #56
  • Loading branch information...
1 parent a15969c commit d891884276b603d04d63105778e21ad96cc53436 @indutny indutny committed Sep 21, 2012
Showing with 6 additions and 7 deletions.
  1. +6 −7 lib/spdy/response.js
View
@@ -1,5 +1,6 @@
var spdy = require('../spdy'),
- http = require('http');
+ http = require('http'),
+ res = http.ServerResponse.prototype;
//
// ### function _renderHeaders ()
@@ -11,15 +12,13 @@ exports._renderHeaders = function() {
throw new Error("Can't render headers after they are sent to the client.");
}
- if (!this._headers) return {};
-
- var headers = {};
- var keys = Object.keys(this._headers);
+ var keys = Object.keys(this._headerNames);
for (var i = 0, l = keys.length; i < l; i++) {
var key = keys[i];
- headers[(this._headerNames[key] || '').toLowerCase()] = this._headers[key];
+ this._headerNames[key] = this._headerNames[key].toLowerCase();
}
- return headers;
+
+ return res._renderHeaders.call(this);
};
//

0 comments on commit d891884

Please sign in to comment.