Skip to content

Commit

Permalink
fixes requested by @nateps
Browse files Browse the repository at this point in the history
  • Loading branch information
respectTheCode committed Sep 23, 2011
1 parent 7507388 commit e62f40a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/gzip.js
Expand Up @@ -45,18 +45,18 @@ exports = module.exports = function gzip(options) {
res.writeHead(res.statusCode);
}
res[name].apply(this, arguments);
}
};
});

res.writeHead = function(code) {
var args = Array.prototype.slice.call(arguments, 0),
write = defaults.write,
end = defaults.end,
headers, key, accept, type, encoding, gzip,ua;
headers, key, accept, type, encoding, gzip, ua;
if (args.length > 1) {
headers = args.pop();
for (key in headers) {
res.setHeader(key, headers[key])
res.setHeader(key, headers[key]);
}
}

Expand All @@ -66,7 +66,6 @@ exports = module.exports = function gzip(options) {
encoding = res.getHeader('content-encoding');

if (code !== 200 || !~accept.indexOf('gzip') ||
~ua.indexOf("MSIE 5") ||
(~ua.indexOf("MSIE 6") && !~ua.indexOf("SV1")) ||
!matchType.test(type) || encoding) {
res.write = write;
Expand Down

0 comments on commit e62f40a

Please sign in to comment.