Skip to content

https.request failed for certain URL after first visting #8368

@codingfishman

Description

@codingfishman
  • Version: v6.2.1
  • Platform: osx 15.3.0 Darwin Kernel Version 15.3.0: Thu Dec 10 18:40:58 PST 2015; root:xnu-3248.30.4~1/RELEASE_X86_64 x86_64
  • Subsystem: https.request

When visiting the specified URL with https.request, the first request is OK but the following request will be failed with :socket hang up after certain timeout. To demostrate it , try the code below:

const url = 'https://weixin.qq.com/zh_CN/htmledition/js/qmtool0cae9c.js';
// with url2, it works fine
const url2 = 'https://camo.githubusercontent.com/8d44df6ff63d2d5fec8336f688f5212dc5354fdb/68747470733a2f2f742e616c697061796f626a656374732e636f6d2f746673636f6d2f54314e774666586e306f58585858585858582e6a70675f343030782e6a7067';
require('https').get(url1, function(res) {
    res.on('data', () => {
    });

    res.on('end', () => {
        console.info('header in res1 is: ', res.headers);
    });

    require('https').get(url1, function(res2) {
        res2.on('data', (data) =>{
            console.info('data2 received:', data);
        });
        res2.on('end', () => {
            console.info('\nheader in res2 is: ', res2.headers);
        });
    });
});

The second request will be failed, while for other HTTPS resources, such as the url2, it works fine. And also for http request it works normally either.

Metadata

Metadata

Assignees

No one assigned

    Labels

    httpIssues or PRs related to the http subsystem.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