-
-
Notifications
You must be signed in to change notification settings - Fork 11.5k
Fixing protocol https not found issue #1904
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
Conversation
|
Nice fix! Would it be better to add the Line 173 in 5d242ce
That way it will only be added if the |
kazi-sabbir
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested the change and found working.
Test URL that redirects from https to http : https://www.thinkadvisor.com/search/?q=insure
|
mark |
Known issue: `Protocol "http:" not supported. Expected "https:"`. More details: axios/axios#1904 (comment)
Fixes #768
Axios determines
isHttpsRequestbased on the protocol in the url. So for urls beginning withhttp://, it will try to use anhttpAgent. Then, if the url internally redirects to https, it throws the "Protocol https not supported" error in the issue above. This only happens when a customhttpAgentis supplied to axios.To fix, we just need to pass both agents to
follow-redirectsand let that package choose based on what protocol it encounters https://github.com/follow-redirects/follow-redirects/blob/v1.4.1/index.js#L121