Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tgambet opened this issue Feb 12, 2024 · 0 comments
Open

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

tgambet opened this issue Feb 12, 2024 · 0 comments

Comments

@tgambet
Copy link

tgambet commented Feb 12, 2024

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant