Fixing protocol https not found issue#1904
Merged
yasuf merged 2 commits intoaxios:masterfrom Dec 25, 2019
Merged
Conversation
giovannigiordano
approved these changes
Feb 5, 2019
|
Nice fix! Would it be better to add the Line 173 in 5d242ce That way it will only be added if the |
DarkSeidNG
approved these changes
Feb 20, 2019
kazi-sabbir
approved these changes
Jul 24, 2019
kazi-sabbir
approved these changes
Jul 24, 2019
kazi-sabbir
left a comment
There was a problem hiding this comment.
Tested the change and found working.
Test URL that redirects from https to http : https://www.thinkadvisor.com/search/?q=insure
32teeth
approved these changes
Jul 24, 2019
|
mark |
freearhey
added a commit
to freearhey/iptv-checker
that referenced
this pull request
Aug 17, 2019
Known issue: `Protocol "http:" not supported. Expected "https:"`. More details: axios/axios#1904 (comment)
This was referenced Jan 7, 2020
This was referenced Apr 3, 2020
Closed
This was referenced Apr 13, 2020
This was referenced Apr 21, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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