{"action":"created","issue":{"url":"https://api.github.com/repos/axios/axios/issues/1228","repository_url":"https://api.github.com/repos/axios/axios","labels_url":"https://api.github.com/repos/axios/axios/issues/1228/labels{/name}","comments_url":"https://api.github.com/repos/axios/axios/issues/1228/comments","events_url":"https://api.github.com/repos/axios/axios/issues/1228/events","html_url":"https://github.com/axios/axios/issues/1228","id":280184642,"number":1228,"title":"Error when using a local URL on baseURL","user":{"login":"eole1712","id":11462388,"avatar_url":"https://avatars3.githubusercontent.com/u/11462388?v=4","gravatar_id":"","url":"https://api.github.com/users/eole1712","html_url":"https://github.com/eole1712","followers_url":"https://api.github.com/users/eole1712/followers","following_url":"https://api.github.com/users/eole1712/following{/other_user}","gists_url":"https://api.github.com/users/eole1712/gists{/gist_id}","starred_url":"https://api.github.com/users/eole1712/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eole1712/subscriptions","organizations_url":"https://api.github.com/users/eole1712/orgs","repos_url":"https://api.github.com/users/eole1712/repos","events_url":"https://api.github.com/users/eole1712/events{/privacy}","received_events_url":"https://api.github.com/users/eole1712/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-12-07T16:04:33Z","updated_at":"2018-05-17T07:03:37Z","closed_at":"2018-01-30T18:49:06Z","author_association":"NONE","body":"\r\n## Summary\r\n\r\nHi there,\r\n\r\nWhen I create a query directly with axios to call on a local URL, it works perfectly.\r\n```\r\naxios.get('http://localhost:3004/health')\r\n```\r\n\r\nBut when I create an axios client in a plugin that contains juste the base url :\r\n```\r\naxios.create({ baseURL: 'http://localhost:3004' })\r\n```\r\n\r\nand import it and then call `.get('/health')`, I have an error :\r\n\r\n```\r\nError: connect EHOSTUNREACH 0.0.11.184:80 - Local (192.168.1.110:49855)\r\nservice-ca |     at Object._errnoException (util.js:1024:11)\r\nservice-ca |     at _exceptionWithHostPort (util.js:1046:20)\r\nservice-ca |     at internalConnect (net.js:971:16)\r\nservice-ca |     at GetAddrInfoReqWrap.emitLookup [as callback] (net.js:1106:7)\r\nservice-ca |     at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:97:10)\r\n```\r\n\r\nWhen I preview the error's stack trace, you can see that the __currentUrl it generates is incorrect since it omits the localhost.\r\n\r\n![axios](https://user-images.githubusercontent.com/11462388/33724695-6c18d1c4-db70-11e7-8d6a-06b81acbee88.png)\r\n\r\n## Context\r\n\r\n- axios version: v0.17.1\r\n- Environment: node v8.9.1, macOS \r\n"},"comment":{"url":"https://api.github.com/repos/axios/axios/issues/comments/389766055","html_url":"https://github.com/axios/axios/issues/1228#issuecomment-389766055","issue_url":"https://api.github.com/repos/axios/axios/issues/1228","id":389766055,"user":{"login":"koresar","id":1622575,"avatar_url":"https://avatars0.githubusercontent.com/u/1622575?v=4","gravatar_id":"","url":"https://api.github.com/users/koresar","html_url":"https://github.com/koresar","followers_url":"https://api.github.com/users/koresar/followers","following_url":"https://api.github.com/users/koresar/following{/other_user}","gists_url":"https://api.github.com/users/koresar/gists{/gist_id}","starred_url":"https://api.github.com/users/koresar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koresar/subscriptions","organizations_url":"https://api.github.com/users/koresar/orgs","repos_url":"https://api.github.com/users/koresar/repos","events_url":"https://api.github.com/users/koresar/events{/privacy}","received_events_url":"https://api.github.com/users/koresar/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T07:03:36Z","updated_at":"2018-05-17T07:03:36Z","author_association":"NONE","body":"@tandrewnichols this is such a helpful last message mate. I was banging my head for an hour.\r\n\r\nThank you for creating this issue and then posting the solution."}}
{"actor":{"display_login":"koresar"}}