{"action":"created","comment":{"url":"https://api.github.com/repos/nodejs/node/pulls/comments/41222254","id":41222254,"diff_hunk":"@@ -22,6 +22,9 @@ function ClientRequest(options, cb) {\n \n   if (typeof options === 'string') {\n     options = url.parse(options);\n+    if (!options.hostname) {\n+      throw new Error('Unable to determine the domain name');\n+    }\n   } else {\n     options = util._extend({}, options);","path":"lib/_http_client.js","position":8,"original_position":8,"commit_id":"7cd15daa0da4484a3199c6e65664b19c69d733a1","original_commit_id":"7cd15daa0da4484a3199c6e65664b19c69d733a1","user":{"login":"Fishrock123","id":1093990,"avatar_url":"https://avatars.githubusercontent.com/u/1093990?v=3","gravatar_id":"","url":"https://api.github.com/users/Fishrock123","html_url":"https://github.com/Fishrock123","followers_url":"https://api.github.com/users/Fishrock123/followers","following_url":"https://api.github.com/users/Fishrock123/following{/other_user}","gists_url":"https://api.github.com/users/Fishrock123/gists{/gist_id}","starred_url":"https://api.github.com/users/Fishrock123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fishrock123/subscriptions","organizations_url":"https://api.github.com/users/Fishrock123/orgs","repos_url":"https://api.github.com/users/Fishrock123/repos","events_url":"https://api.github.com/users/Fishrock123/events{/privacy}","received_events_url":"https://api.github.com/users/Fishrock123/received_events","type":"User","site_admin":false},"body":"Don't we also need the check here? Why not just check after these `if` statements?","created_at":"2015-10-06T03:07:49Z","updated_at":"2015-10-06T03:07:49Z","html_url":"https://github.com/nodejs/node/pull/2967#discussion_r41222254","pull_request_url":"https://api.github.com/repos/nodejs/node/pulls/2967","_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments/41222254"},"html":{"href":"https://github.com/nodejs/node/pull/2967#discussion_r41222254"},"pull_request":{"href":"https://api.github.com/repos/nodejs/node/pulls/2967"}}},"pull_request":{"url":"https://api.github.com/repos/nodejs/node/pulls/2967","id":45491759,"html_url":"https://github.com/nodejs/node/pull/2967","diff_url":"https://github.com/nodejs/node/pull/2967.diff","patch_url":"https://github.com/nodejs/node/pull/2967.patch","issue_url":"https://api.github.com/repos/nodejs/node/issues/2967","number":2967,"state":"open","locked":false,"title":"http{s}: fix connecting to localhost if URL is invalid","user":{"login":"thefourtheye","id":696611,"avatar_url":"https://avatars.githubusercontent.com/u/696611?v=3","gravatar_id":"","url":"https://api.github.com/users/thefourtheye","html_url":"https://github.com/thefourtheye","followers_url":"https://api.github.com/users/thefourtheye/followers","following_url":"https://api.github.com/users/thefourtheye/following{/other_user}","gists_url":"https://api.github.com/users/thefourtheye/gists{/gist_id}","starred_url":"https://api.github.com/users/thefourtheye/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thefourtheye/subscriptions","organizations_url":"https://api.github.com/users/thefourtheye/orgs","repos_url":"https://api.github.com/users/thefourtheye/repos","events_url":"https://api.github.com/users/thefourtheye/events{/privacy}","received_events_url":"https://api.github.com/users/thefourtheye/received_events","type":"User","site_admin":false},"body":"If the URL passed to `http.request` is not properly parsable by `url.parse`, we\r\nfall back to use `localhost` and port 80. This creates confusing error messages\r\nlike in this question http://stackoverflow.com/q/32675907/1903116.\r\n\r\nThis patch throws an error message, if `url.parse` fails to parse the URL.\r\n\r\nPrevious Discussion: https://github.com/nodejs/node/pull/2966","created_at":"2015-09-20T07:40:27Z","updated_at":"2015-10-06T03:07:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aa4aca4fe70fa96d142e2348396394c551fb7fc3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nodejs/node/pulls/2967/commits","review_comments_url":"https://api.github.com/repos/nodejs/node/pulls/2967/comments","review_comment_url":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nodejs/node/issues/2967/comments","statuses_url":"https://api.github.com/repos/nodejs/node/statuses/7cd15daa0da4484a3199c6e65664b19c69d733a1","head":{"label":"thefourtheye:http-fix-invalid-urls","ref":"http-fix-invalid-urls","sha":"7cd15daa0da4484a3199c6e65664b19c69d733a1","user":{"login":"thefourtheye","id":696611,"avatar_url":"https://avatars.githubusercontent.com/u/696611?v=3","gravatar_id":"","url":"https://api.github.com/users/thefourtheye","html_url":"https://github.com/thefourtheye","followers_url":"https://api.github.com/users/thefourtheye/followers","following_url":"https://api.github.com/users/thefourtheye/following{/other_user}","gists_url":"https://api.github.com/users/thefourtheye/gists{/gist_id}","starred_url":"https://api.github.com/users/thefourtheye/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thefourtheye/subscriptions","organizations_url":"https://api.github.com/users/thefourtheye/orgs","repos_url":"https://api.github.com/users/thefourtheye/repos","events_url":"https://api.github.com/users/thefourtheye/events{/privacy}","received_events_url":"https://api.github.com/users/thefourtheye/received_events","type":"User","site_admin":false},"repo":{"id":35113605,"name":"io.js","full_name":"thefourtheye/io.js","owner":{"login":"thefourtheye","id":696611,"avatar_url":"https://avatars.githubusercontent.com/u/696611?v=3","gravatar_id":"","url":"https://api.github.com/users/thefourtheye","html_url":"https://github.com/thefourtheye","followers_url":"https://api.github.com/users/thefourtheye/followers","following_url":"https://api.github.com/users/thefourtheye/following{/other_user}","gists_url":"https://api.github.com/users/thefourtheye/gists{/gist_id}","starred_url":"https://api.github.com/users/thefourtheye/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thefourtheye/subscriptions","organizations_url":"https://api.github.com/users/thefourtheye/orgs","repos_url":"https://api.github.com/users/thefourtheye/repos","events_url":"https://api.github.com/users/thefourtheye/events{/privacy}","received_events_url":"https://api.github.com/users/thefourtheye/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/thefourtheye/io.js","description":"A friendly fork of Node.js with an open governance model","fork":true,"url":"https://api.github.com/repos/thefourtheye/io.js","forks_url":"https://api.github.com/repos/thefourtheye/io.js/forks","keys_url":"https://api.github.com/repos/thefourtheye/io.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thefourtheye/io.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thefourtheye/io.js/teams","hooks_url":"https://api.github.com/repos/thefourtheye/io.js/hooks","issue_events_url":"https://api.github.com/repos/thefourtheye/io.js/issues/events{/number}","events_url":"https://api.github.com/repos/thefourtheye/io.js/events","assignees_url":"https://api.github.com/repos/thefourtheye/io.js/assignees{/user}","branches_url":"https://api.github.com/repos/thefourtheye/io.js/branches{/branch}","tags_url":"https://api.github.com/repos/thefourtheye/io.js/tags","blobs_url":"https://api.github.com/repos/thefourtheye/io.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thefourtheye/io.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thefourtheye/io.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/thefourtheye/io.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thefourtheye/io.js/statuses/{sha}","languages_url":"https://api.github.com/repos/thefourtheye/io.js/languages","stargazers_url":"https://api.github.com/repos/thefourtheye/io.js/stargazers","contributors_url":"https://api.github.com/repos/thefourtheye/io.js/contributors","subscribers_url":"https://api.github.com/repos/thefourtheye/io.js/subscribers","subscription_url":"https://api.github.com/repos/thefourtheye/io.js/subscription","commits_url":"https://api.github.com/repos/thefourtheye/io.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/thefourtheye/io.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/thefourtheye/io.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/thefourtheye/io.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/thefourtheye/io.js/contents/{+path}","compare_url":"https://api.github.com/repos/thefourtheye/io.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thefourtheye/io.js/merges","archive_url":"https://api.github.com/repos/thefourtheye/io.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thefourtheye/io.js/downloads","issues_url":"https://api.github.com/repos/thefourtheye/io.js/issues{/number}","pulls_url":"https://api.github.com/repos/thefourtheye/io.js/pulls{/number}","milestones_url":"https://api.github.com/repos/thefourtheye/io.js/milestones{/number}","notifications_url":"https://api.github.com/repos/thefourtheye/io.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thefourtheye/io.js/labels{/name}","releases_url":"https://api.github.com/repos/thefourtheye/io.js/releases{/id}","created_at":"2015-05-05T17:20:53Z","updated_at":"2015-05-05T17:20:56Z","pushed_at":"2015-10-04T19:04:43Z","git_url":"git://github.com/thefourtheye/io.js.git","ssh_url":"git@github.com:thefourtheye/io.js.git","clone_url":"https://github.com/thefourtheye/io.js.git","svn_url":"https://github.com/thefourtheye/io.js","homepage":"https://iojs.org","size":144562,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"nodejs:master","ref":"master","sha":"d32363ff2049a5d6f53d3e9ce7255c474838a6d5","user":{"login":"nodejs","id":9950313,"avatar_url":"https://avatars.githubusercontent.com/u/9950313?v=3","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"repo":{"id":27193779,"name":"node","full_name":"nodejs/node","owner":{"login":"nodejs","id":9950313,"avatar_url":"https://avatars.githubusercontent.com/u/9950313?v=3","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nodejs/node","description":"✨Node.js  ✨","fork":false,"url":"https://api.github.com/repos/nodejs/node","forks_url":"https://api.github.com/repos/nodejs/node/forks","keys_url":"https://api.github.com/repos/nodejs/node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nodejs/node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nodejs/node/teams","hooks_url":"https://api.github.com/repos/nodejs/node/hooks","issue_events_url":"https://api.github.com/repos/nodejs/node/issues/events{/number}","events_url":"https://api.github.com/repos/nodejs/node/events","assignees_url":"https://api.github.com/repos/nodejs/node/assignees{/user}","branches_url":"https://api.github.com/repos/nodejs/node/branches{/branch}","tags_url":"https://api.github.com/repos/nodejs/node/tags","blobs_url":"https://api.github.com/repos/nodejs/node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nodejs/node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nodejs/node/git/refs{/sha}","trees_url":"https://api.github.com/repos/nodejs/node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nodejs/node/statuses/{sha}","languages_url":"https://api.github.com/repos/nodejs/node/languages","stargazers_url":"https://api.github.com/repos/nodejs/node/stargazers","contributors_url":"https://api.github.com/repos/nodejs/node/contributors","subscribers_url":"https://api.github.com/repos/nodejs/node/subscribers","subscription_url":"https://api.github.com/repos/nodejs/node/subscription","commits_url":"https://api.github.com/repos/nodejs/node/commits{/sha}","git_commits_url":"https://api.github.com/repos/nodejs/node/git/commits{/sha}","comments_url":"https://api.github.com/repos/nodejs/node/comments{/number}","issue_comment_url":"https://api.github.com/repos/nodejs/node/issues/comments{/number}","contents_url":"https://api.github.com/repos/nodejs/node/contents/{+path}","compare_url":"https://api.github.com/repos/nodejs/node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nodejs/node/merges","archive_url":"https://api.github.com/repos/nodejs/node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nodejs/node/downloads","issues_url":"https://api.github.com/repos/nodejs/node/issues{/number}","pulls_url":"https://api.github.com/repos/nodejs/node/pulls{/number}","milestones_url":"https://api.github.com/repos/nodejs/node/milestones{/number}","notifications_url":"https://api.github.com/repos/nodejs/node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nodejs/node/labels{/name}","releases_url":"https://api.github.com/repos/nodejs/node/releases{/id}","created_at":"2014-11-26T19:57:11Z","updated_at":"2015-10-05T22:44:23Z","pushed_at":"2015-10-06T01:49:02Z","git_url":"git://github.com/nodejs/node.git","ssh_url":"git@github.com:nodejs/node.git","clone_url":"https://github.com/nodejs/node.git","svn_url":"https://github.com/nodejs/node","homepage":"https://nodejs.org","size":368011,"stargazers_count":15827,"watchers_count":15827,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1468,"mirror_url":null,"open_issues_count":505,"forks":1468,"open_issues":505,"watchers":15827,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/2967"},"html":{"href":"https://github.com/nodejs/node/pull/2967"},"issue":{"href":"https://api.github.com/repos/nodejs/node/issues/2967"},"comments":{"href":"https://api.github.com/repos/nodejs/node/issues/2967/comments"},"review_comments":{"href":"https://api.github.com/repos/nodejs/node/pulls/2967/comments"},"review_comment":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nodejs/node/pulls/2967/commits"},"statuses":{"href":"https://api.github.com/repos/nodejs/node/statuses/7cd15daa0da4484a3199c6e65664b19c69d733a1"}}}}