You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
My initial impression after reading #490 and 7c89704 is that Axios can handle URLs without protocol (ie. www.google.com) by defaulting to http. But when I try
To figure it out, I looked into the http adaptor and realized that 7c89704 was adding a default protocol for proxy only but not for the normal case.
So I thought about creating a PR to fix that but then I realized we are parsing the url using nodejs url module, but url can't handle URL without protocol, calling url.parse('www.google.com') generates:
whose pathname and path are totally wrong. And if the url module can't parsing the url correct, I think there is little Axios can do to provide support. The best option here is to explicitly state that Axios doesn't support urls without protocols and throw an error with that message.
Describe the solution you'd like
Explicitly state in the doc that Axios doesn't support incomplete URLs (ie. www.google.com) and throw an error when receiving such URL through url or baseURL.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
My initial impression after reading #490 and 7c89704 is that Axios can handle URLs without protocol (ie.
www.google.com
) by defaulting tohttp
. But when I tryan error was thrown:
To figure it out, I looked into the http adaptor and realized that 7c89704 was adding a default protocol for proxy only but not for the normal case.
So I thought about creating a PR to fix that but then I realized we are parsing the url using nodejs
url
module, buturl
can't handle URL without protocol, callingurl.parse('www.google.com')
generates:whose pathname and path are totally wrong. And if the
url
module can't parsing the url correct, I think there is little Axios can do to provide support. The best option here is to explicitly state that Axios doesn't support urls without protocols and throw an error with that message.Describe the solution you'd like
Explicitly state in the doc that Axios doesn't support incomplete URLs (ie.
www.google.com
) and throw an error when receiving such URL throughurl
orbaseURL
.The text was updated successfully, but these errors were encountered: