Skip to content

Commit

Permalink
Merge pull request #589 from wpreul/master
Browse files Browse the repository at this point in the history
Sending a gzipped proxy response now works correctly
  • Loading branch information
Eran Hammer committed Feb 27, 2013
2 parents eec8347 + 63b6dab commit fbf3b47
Show file tree
Hide file tree
Showing 2 changed files with 780 additions and 755 deletions.
9 changes: 8 additions & 1 deletion lib/response/stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,14 @@ internals.Stream.prototype._transmit = function (request, callback) {
var gzip = null;

if (isGzip) {
delete this._headers['Content-Length'];

Object.keys(this._headers).forEach(function (key) {

if (/content\-length/i.test(key)) { // Can be lowercase when coming from proxy
delete self._headers[key];
}
});

this._headers['Content-Encoding'] = 'gzip';
this._headers.Vary = 'Accept-Encoding';
gzip = Zlib.createGzip();
Expand Down
Loading

0 comments on commit fbf3b47

Please sign in to comment.