Skip to content

HEAD requests with Node v5 have issues with gzipped content and fail. #2045

@czardoz

Description

@czardoz

This script reproduces the issue:

    var req = require('request');

    req({
        url: 'http://google.com',
        method: 'HEAD',
        headers: {},
        followAllRedirects: false,
        followRedirect: true,
        jar: true,
        timeout: 15000,
        gzip: true,
        rejectUnauthorized: false,
        strictSSL: true
    }, function (err, res, body) {
        if (err) {
            console.error(err.stack || err);
        }
    });

Steps to reproduce:

aniket [/tmp/request-bug] -> node -v
v5.1.0
aniket [/tmp/request-bug] -> npm -v
3.3.12
aniket [/tmp/request-bug] -> cat node_modules/request/package.json| grep version
  "version": "2.69.0"
aniket [/tmp/request-bug] -> node reproduce.js 
Error: unexpected end of file
    at Zlib._handle.onerror (zlib.js:363:17)
aniket [/tmp/request-bug] -> 

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions