lib/collection/response.js
function () {
        var contentEncoding = this.headers.get(CONTENT_ENCODING),
            body = this.stream || this.body,
            source;

        if (contentEncoding) {
            source = HEADER;
        }

        // if the encoding is not found, we check
        else if (body) { // @todo add detection for deflate
            // eslint-disable-next-line lodash/prefer-matches
            if (body[0] === 0x1F && body[1] === 0x8B && body[2] === 0x8) {
                contentEncoding = GZIP;
            }

            if (contentEncoding) {
                source = BODY;
            }
        }

        return {
            format: contentEncoding,
            source: source
        };
    }
function () {
        var contentEncoding = this.headers.get(CONTENT_ENCODING),
            body = this.stream || this.body,
            source;

        if (contentEncoding) {
            source = HEADER;
        }

        // if the encoding is not found, we check
        else if (body) { // @todo add detection for deflate
            // eslint-disable-next-line lodash/prefer-matches
            if (body[0] === 0x1F && body[1] === 0x8B && body[2] === 0x8) {
                contentEncoding = GZIP;
            }

            if (contentEncoding) {
                source = BODY;
            }
        }

        return {
            format: contentEncoding,
            source: source
        };
    }
function ( ) { var contentEncoding = this . headers . get ( CONTENT_ENCODING ) , body = this . stream || this . body , source ; if ( contentEncoding ) { source = HEADER ; } // if the encoding is not found, we check else if ( body ) { // @todo add detection for deflate // eslint-disable-next-line lodash/prefer-matches if ( body [ 0 ] === 0x1F && body [ 1 ] === 0x8B && body [ 2 ] === 0x8 ) { contentEncoding = GZIP ; } if ( contentEncoding ) { source = BODY ; } } return { format : contentEncoding , source : source } ; }
Returns the response encoding defined as header or detected from body.

@private
@returns {Object} - {format: string, source: string}
Returns the response encoding defined as header or detected from body .