{"action":"created","issue":{"url":"https://api.github.com/repos/nneves/UrlSearchEngine/issues/2","repository_url":"https://api.github.com/repos/nneves/UrlSearchEngine","labels_url":"https://api.github.com/repos/nneves/UrlSearchEngine/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/nneves/UrlSearchEngine/issues/2/comments","events_url":"https://api.github.com/repos/nneves/UrlSearchEngine/issues/2/events","html_url":"https://github.com/nneves/UrlSearchEngine/issues/2","id":196566883,"number":2,"title":"GetContentFromUrl service does not fail requests to bad addresses","user":{"login":"mcoquet","id":117676,"avatar_url":"https://avatars.githubusercontent.com/u/117676?v=3","gravatar_id":"","url":"https://api.github.com/users/mcoquet","html_url":"https://github.com/mcoquet","followers_url":"https://api.github.com/users/mcoquet/followers","following_url":"https://api.github.com/users/mcoquet/following{/other_user}","gists_url":"https://api.github.com/users/mcoquet/gists{/gist_id}","starred_url":"https://api.github.com/users/mcoquet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcoquet/subscriptions","organizations_url":"https://api.github.com/users/mcoquet/orgs","repos_url":"https://api.github.com/users/mcoquet/repos","events_url":"https://api.github.com/users/mcoquet/events{/privacy}","received_events_url":"https://api.github.com/users/mcoquet/received_events","type":"User","site_admin":false},"labels":[{"id":497108077,"url":"https://api.github.com/repos/nneves/UrlSearchEngine/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-20T01:51:45Z","updated_at":"2016-12-20T17:47:10Z","closed_at":null,"body":"when you provide a fake request like `moo` instead of `www.botdream.com` the service responds with a 200 but the content reads `ENOENT`\r\n\r\nI suggest It should forward whatever the upstream returns (404, 500, etc)"},"comment":{"url":"https://api.github.com/repos/nneves/UrlSearchEngine/issues/comments/268309321","html_url":"https://github.com/nneves/UrlSearchEngine/issues/2#issuecomment-268309321","issue_url":"https://api.github.com/repos/nneves/UrlSearchEngine/issues/2","id":268309321,"user":{"login":"nneves","id":878494,"avatar_url":"https://avatars.githubusercontent.com/u/878494?v=3","gravatar_id":"","url":"https://api.github.com/users/nneves","html_url":"https://github.com/nneves","followers_url":"https://api.github.com/users/nneves/followers","following_url":"https://api.github.com/users/nneves/following{/other_user}","gists_url":"https://api.github.com/users/nneves/gists{/gist_id}","starred_url":"https://api.github.com/users/nneves/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nneves/subscriptions","organizations_url":"https://api.github.com/users/nneves/orgs","repos_url":"https://api.github.com/users/nneves/repos","events_url":"https://api.github.com/users/nneves/events{/privacy}","received_events_url":"https://api.github.com/users/nneves/received_events","type":"User","site_admin":false},"created_at":"2016-12-20T17:47:10Z","updated_at":"2016-12-20T17:47:10Z","body":"This is a tricky one, Request module is responding with this data:\r\n\r\n* Successfully request  `curl http://localhost:6000/\\?url\\=www.botdream.com`\r\nresponse and body properties are not undefined, error is undefined\r\n\r\n```\r\nresponse.statusCode => 200\r\nresponse.statusMessage => OK\r\n````\r\nall good, I can forward this to the initial request!\r\n\r\n* Bad request  `curl http://localhost:6000/\\?url\\=moo`\r\n\r\nresponse and body properties are undefined, error contains data\r\n\r\n```\r\nerror.code => ENOTFOUND\r\nerror.errno => ENOTFOUND\r\n```\r\n\r\nThere is no http response.statusCode returned!!!\r\n\r\n\r\n\r\n\r\nMy suggestion, I will forward the successfully statusCode/statusMessage to the initial request call when things run normally without errors!\r\n\r\nIn case of some sort of error, I will return an hardcoded statusCode=500 and statusMessage=error.errno!\r\n\r\n@mcoquet do you agree or have another idea ?"}}
{"actor":{"display_login":"nneves"}}