{"action":"created","issue":{"url":"https://api.github.com/repos/messagebird/messagebird-nodejs/issues/16","repository_url":"https://api.github.com/repos/messagebird/messagebird-nodejs","labels_url":"https://api.github.com/repos/messagebird/messagebird-nodejs/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/messagebird/messagebird-nodejs/issues/16/comments","events_url":"https://api.github.com/repos/messagebird/messagebird-nodejs/issues/16/events","html_url":"https://github.com/messagebird/messagebird-nodejs/pull/16","id":323305474,"node_id":"MDExOlB1bGxSZXF1ZXN0MTg4MTk1NTg1","number":16,"title":"URL-encode phone numbers so Lookup API can handle formats with spaces","user":{"login":"LukasRos","id":192050,"node_id":"MDQ6VXNlcjE5MjA1MA==","avatar_url":"https://avatars0.githubusercontent.com/u/192050?v=4","gravatar_id":"","url":"https://api.github.com/users/LukasRos","html_url":"https://github.com/LukasRos","followers_url":"https://api.github.com/users/LukasRos/followers","following_url":"https://api.github.com/users/LukasRos/following{/other_user}","gists_url":"https://api.github.com/users/LukasRos/gists{/gist_id}","starred_url":"https://api.github.com/users/LukasRos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LukasRos/subscriptions","organizations_url":"https://api.github.com/users/LukasRos/orgs","repos_url":"https://api.github.com/users/LukasRos/repos","events_url":"https://api.github.com/users/LukasRos/events{/privacy}","received_events_url":"https://api.github.com/users/LukasRos/received_events","type":"User","site_admin":false},"labels":[{"id":236632058,"node_id":"MDU6TGFiZWwyMzY2MzIwNTg=","url":"https://api.github.com/repos/messagebird/messagebird-nodejs/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-05-15T17:06:12Z","updated_at":"2018-07-04T15:47:19Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/messagebird/messagebird-nodejs/pulls/16","html_url":"https://github.com/messagebird/messagebird-nodejs/pull/16","diff_url":"https://github.com/messagebird/messagebird-nodejs/pull/16.diff","patch_url":"https://github.com/messagebird/messagebird-nodejs/pull/16.patch"},"body":"The Lookup API can be used to parse and normalize phone numbers but it fails (with `TypeError [ERR_UNESCAPED_CHARACTERS]: Request path contains unescaped characters`) when the number contains spaces. Developers would have to URL-encode numbers, which is against the principle that an SDK should abstract HTTP details. This PR fixes that by URL-encoding within the SDK."},"comment":{"url":"https://api.github.com/repos/messagebird/messagebird-nodejs/issues/comments/402513966","html_url":"https://github.com/messagebird/messagebird-nodejs/pull/16#issuecomment-402513966","issue_url":"https://api.github.com/repos/messagebird/messagebird-nodejs/issues/16","id":402513966,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMjUxMzk2Ng==","user":{"login":"epels","id":9115513,"node_id":"MDQ6VXNlcjkxMTU1MTM=","avatar_url":"https://avatars1.githubusercontent.com/u/9115513?v=4","gravatar_id":"","url":"https://api.github.com/users/epels","html_url":"https://github.com/epels","followers_url":"https://api.github.com/users/epels/followers","following_url":"https://api.github.com/users/epels/following{/other_user}","gists_url":"https://api.github.com/users/epels/gists{/gist_id}","starred_url":"https://api.github.com/users/epels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/epels/subscriptions","organizations_url":"https://api.github.com/users/epels/orgs","repos_url":"https://api.github.com/users/epels/repos","events_url":"https://api.github.com/users/epels/events{/privacy}","received_events_url":"https://api.github.com/users/epels/received_events","type":"User","site_admin":false},"created_at":"2018-07-04T15:47:19Z","updated_at":"2018-07-04T15:47:19Z","author_association":"MEMBER","body":"Hi @LukasRos, thanks again - and sorry it took a little longer to get back to you. I definitely agree encoding query parameters is something a client/SDK should take care off. \r\n\r\nI'd just like to point out that this change is backwards incompatible: users who have ran into this same issue may already be encoding the phone numbers on their end. Merging this as-is would result in them ending up with double encoded, and thus malformed, strings.\r\n\r\nA simple and effective solution for this would be to first decode the provided string, and _then_ encoding that result (e.g. `encodeURIComponent(decodeURIComponent(phoneNumber))`). What do you think? Also, it would be great to have some tests for this.\r\n\r\nThanks!"}}
{"actor":{"display_login":"epels"}}