lib/plugins/HttpPlugin.js
function decompressResponse (res) {
  var encoding = lowercase(res.headers['content-encoding']);
  var isCompressed = ['gzip', 'compress', 'deflate'].indexOf(encoding) >= 0;

  if (isCompressed) {
    // The response is compressed, so add decompression middleware to the stream
    res.pipe(zlib.createUnzip());

    // Remove the content-encoding header, to prevent double-decoding
    delete res.headers['content-encoding'];
  }
}
function decompressResponse (res) {
  var encoding = lowercase(res.headers['content-encoding']);
  var isCompressed = ['gzip', 'compress', 'deflate'].indexOf(encoding) >= 0;

  if (isCompressed) {
    // The response is compressed, so add decompression middleware to the stream
    res.pipe(zlib.createUnzip());

    // Remove the content-encoding header, to prevent double-decoding
    delete res.headers['content-encoding'];
  }
}
function decompressResponse ( res ) { var encoding = lowercase ( res . headers [ 'content-encoding' ] ) ; var isCompressed = [ 'gzip' , 'compress' , 'deflate' ] . indexOf ( encoding ) >= 0 ; if ( isCompressed ) { // The response is compressed, so add decompression middleware to the stream res . pipe ( zlib . createUnzip ( ) ) ; // Remove the content-encoding header, to prevent double-decoding delete res . headers [ 'content-encoding' ] ; } }
Adds decompression middleware to the response stream if necessary.

@param {IncomingMessage} res
Adds decompression middleware to the response stream if necessary .