Skip to content

http request will hang forever #39341

Open
@liran

Description

@liran

Version

v15.10.0

Platform

Darwin Lis-iMac.local 19.6.0 Darwin Kernel Version 19.6.0: Thu Oct 29 22:56:45 PDT 2020; root:xnu-6153.141.2.2~1/RELEASE_X86_64 x86_64

Subsystem

macos catalina 10.15.7

What steps will reproduce the bug?

const https = require('https');

async function main() {
  const options = {
    hostname: 'www.dhgate.com',
    port: 443,
    path: '/product/magnetic-liquid-eyeliner-magnetic-false-eyelashes/481362313.html',
    method: 'GET',
    headers: {
      accept:
        'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
      'accept-language': 'en',
      'user-agent':
        'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36',
    },
  };
  const req = https.request(options, (res) => {
    console.log('statusCode:', res.statusCode);
    console.log('headers:', res.headers);

    res.on('data', (d) => {
      process.stdout.write(d);
    });
  });
  req.on('error', (e) => {
    console.error(e);
  });
  req.end();
}

main();

How often does it reproduce? Is there a required condition?

No matter what system it will happen

What is the expected behavior?

receive the information returned by the server normally

What do you see instead?

hang forever

Additional information

I have tried many versions of nodejs, but none of them are normal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    httpsIssues or PRs related to the https subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions