{"action":"created","issue":{"url":"https://api.github.com/repos/request/request/issues/1678","labels_url":"https://api.github.com/repos/request/request/issues/1678/labels{/name}","comments_url":"https://api.github.com/repos/request/request/issues/1678/comments","events_url":"https://api.github.com/repos/request/request/issues/1678/events","html_url":"https://github.com/request/request/issues/1678","id":95237837,"number":1678,"title":"Accented character on url responds with 404","user":{"login":"dinostheo","id":1632257,"avatar_url":"https://avatars.githubusercontent.com/u/1632257?v=3","gravatar_id":"","url":"https://api.github.com/users/dinostheo","html_url":"https://github.com/dinostheo","followers_url":"https://api.github.com/users/dinostheo/followers","following_url":"https://api.github.com/users/dinostheo/following{/other_user}","gists_url":"https://api.github.com/users/dinostheo/gists{/gist_id}","starred_url":"https://api.github.com/users/dinostheo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dinostheo/subscriptions","organizations_url":"https://api.github.com/users/dinostheo/orgs","repos_url":"https://api.github.com/users/dinostheo/repos","events_url":"https://api.github.com/users/dinostheo/events{/privacy}","received_events_url":"https://api.github.com/users/dinostheo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-15T16:39:32Z","updated_at":"2015-07-16T10:02:38Z","closed_at":null,"body":"Hi,\r\n\r\nI was trying to fetch the content of an image using request and the module responds with a 404. Debugging on the `onRequestResponse` method I get the following response:\r\n```\r\nonRequestResponse http://www.tecnofanatico.com/wp-content/uploads/2015/07/Sin-título-1-150x150.png 404 { date: 'Wed, 15 Jul 2015 16:04:59 GMT',\r\n  server: 'Apache/2.2.29 (Unix) mod_ssl/2.2.29 OpenSSL/1.0.1e-fips mod_bwlimited/1.4',\r\n  'x-powered-by': 'PHP/5.4.33',\r\n  vary: 'Cookie',\r\n  'x-pingback': 'http://www.tecnofanatico.com/xmlrpc.php',\r\n  expires: 'Wed, 11 Jan 1984 05:00:00 GMT',\r\n  'cache-control': 'no-cache, must-revalidate, max-age=0',\r\n  pragma: 'no-cache',\r\n  connection: 'close',\r\n  'transfer-encoding': 'chunked',\r\n  'content-type': 'text/html; charset=UTF-8' }\r\n```\r\n\r\nThe url is valid and displays an image, but I've noticed an accented i character `í` in the filename. \r\nBtw I am using node version `0.12.6`.\r\n\r\nSo, this is not all. \r\nI tried with node version `0.10.38` and it works... \r\nHere's the debugging output, while using `0.10.38`\r\n```\r\nonRequestResponse http://www.tecnofanatico.com/wp-content/uploads/2015/07/Sin-título-1-150x150.png 200 { date: 'Wed, 15 Jul 2015 16:13:30 GMT',\r\n  server: 'Apache/2.2.29 (Unix) mod_ssl/2.2.29 OpenSSL/1.0.1e-fips mod_bwlimited/1.4',\r\n  'last-modified': 'Wed, 01 Jul 2015 15:29:46 GMT',\r\n  etag: '\"54603fd-82ed-519d1fe2a7d25\"',\r\n  'accept-ranges': 'bytes',\r\n  'content-length': '33517',\r\n  'keep-alive': 'timeout=5, max=100',\r\n  connection: 'Keep-Alive',\r\n  'content-type': 'image/png' }\r\n```"},"comment":{"url":"https://api.github.com/repos/request/request/issues/comments/121914470","html_url":"https://github.com/request/request/issues/1678#issuecomment-121914470","issue_url":"https://api.github.com/repos/request/request/issues/1678","id":121914470,"user":{"login":"mvdwalle","id":6840983,"avatar_url":"https://avatars.githubusercontent.com/u/6840983?v=3","gravatar_id":"","url":"https://api.github.com/users/mvdwalle","html_url":"https://github.com/mvdwalle","followers_url":"https://api.github.com/users/mvdwalle/followers","following_url":"https://api.github.com/users/mvdwalle/following{/other_user}","gists_url":"https://api.github.com/users/mvdwalle/gists{/gist_id}","starred_url":"https://api.github.com/users/mvdwalle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mvdwalle/subscriptions","organizations_url":"https://api.github.com/users/mvdwalle/orgs","repos_url":"https://api.github.com/users/mvdwalle/repos","events_url":"https://api.github.com/users/mvdwalle/events{/privacy}","received_events_url":"https://api.github.com/users/mvdwalle/received_events","type":"User","site_admin":false},"created_at":"2015-07-16T10:02:38Z","updated_at":"2015-07-16T10:02:38Z","body":"Basicly properly URL encoding the URL. Below is how I done it\r\n\r\n```\r\n// Prevent double decoding\r\nurl = decodeURIComponent(url);\r\n\r\n// Encode path if needed\r\nvar parts = urllib.parse(url);\r\nif (parts.pathname) {\r\n    parts.pathname = parts.pathname.split('/').map(function (part) {\r\n        return encodeURIComponent(part);\r\n    }).join('/');\r\n    url = urllib.format(parts);\r\n}\r\n```"}}