Skip to content

Support HTTPS servers without HTTP/2 support in auto.js #102

@tgambet

Description

@tgambet

While running some requests through got using http2-wrapper I stumbled upon the following error when requesting websites that support SSL but do not seem to support HTTP/2. Edit: I believe it might be related to redirects.

Protocol "https:" not supported. Expected "http:"

The culprit seems to be this line:

return delayAsyncDestroy(http.request(options, callback));

Changing it to

return delayAsyncDestroy((isHttps ? https : http).request(options, callback)); 

fixed the issue for me.

Have someone else been affected by this error ?
Is it the correct fix ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions