{"action":"created","issue":{"url":"https://api.github.com/repos/joshnesbitt/google_url_shortener/issues/9","repository_url":"https://api.github.com/repos/joshnesbitt/google_url_shortener","labels_url":"https://api.github.com/repos/joshnesbitt/google_url_shortener/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/joshnesbitt/google_url_shortener/issues/9/comments","events_url":"https://api.github.com/repos/joshnesbitt/google_url_shortener/issues/9/events","html_url":"https://github.com/joshnesbitt/google_url_shortener/issues/9","id":193787417,"number":9,"title":"It breaks with custom URIs","user":{"login":"rhymes","id":146201,"avatar_url":"https://avatars3.githubusercontent.com/u/146201?v=4","gravatar_id":"","url":"https://api.github.com/users/rhymes","html_url":"https://github.com/rhymes","followers_url":"https://api.github.com/users/rhymes/followers","following_url":"https://api.github.com/users/rhymes/following{/other_user}","gists_url":"https://api.github.com/users/rhymes/gists{/gist_id}","starred_url":"https://api.github.com/users/rhymes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhymes/subscriptions","organizations_url":"https://api.github.com/users/rhymes/orgs","repos_url":"https://api.github.com/users/rhymes/repos","events_url":"https://api.github.com/users/rhymes/events{/privacy}","received_events_url":"https://api.github.com/users/rhymes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-12-06T14:34:50Z","updated_at":"2018-04-17T02:59:06Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I'm honestly not sure what's supposed to do with non-HTTP custom URIs but I thought you might want to know that it raises an error if given a custom URI:\r\n\r\n```ruby\r\n[13] pry(main)> url\r\n=> \"ovsapp://foobar\"\r\n[14] pry(main)> Google::UrlShortener.shorten!(url)\r\nRestClient.post \"https://www.googleapis.com/urlshortener/v1/url?key=MY_KEY\", \"{\\\"longUrl\\\":\\\"ovsapp://foobar\\\"}\", \"Accept\"=>\"application/json\", \"Accept-Encoding\"=>\"gzip, deflate\", \"Content-Length\"=>\"29\", \"Content-Type\"=>\"application/json\", \"User-Agent\"=>\"rest-client/2.0.0 (darwin16.1.0 x86_64) ruby/2.3.3p222\"\r\n# => 400 BadRequest | application/json 160 bytes\r\n#<RestClient::BadRequest: 400 Bad Request>\r\nNoMethodError: undefined method `[]' for nil:NilClass\r\nfrom /Users/rhymes/.rvm/gems/ruby-2.3.3/gems/google_url_shortener-1.1.0/lib/google/url_shortener/url.rb:27:in `encode!'\r\n```\r\n\r\nit seems like https://github.com/joshnesbitt/google_url_shortener/blob/master/lib/google/url_shortener/url.rb#L25 returns nil as response, and then at line https://github.com/joshnesbitt/google_url_shortener/blob/master/lib/google/url_shortener/url.rb#L27 it breaks.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/joshnesbitt/google_url_shortener/issues/comments/381817791","html_url":"https://github.com/joshnesbitt/google_url_shortener/issues/9#issuecomment-381817791","issue_url":"https://api.github.com/repos/joshnesbitt/google_url_shortener/issues/9","id":381817791,"user":{"login":"bf4","id":142914,"avatar_url":"https://avatars2.githubusercontent.com/u/142914?v=4","gravatar_id":"","url":"https://api.github.com/users/bf4","html_url":"https://github.com/bf4","followers_url":"https://api.github.com/users/bf4/followers","following_url":"https://api.github.com/users/bf4/following{/other_user}","gists_url":"https://api.github.com/users/bf4/gists{/gist_id}","starred_url":"https://api.github.com/users/bf4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bf4/subscriptions","organizations_url":"https://api.github.com/users/bf4/orgs","repos_url":"https://api.github.com/users/bf4/repos","events_url":"https://api.github.com/users/bf4/events{/privacy}","received_events_url":"https://api.github.com/users/bf4/received_events","type":"User","site_admin":false},"created_at":"2018-04-17T02:59:06Z","updated_at":"2018-04-17T02:59:06Z","author_association":"NONE","body":"Sounds like this can be closed?"}}
{"actor":{"display_login":"bf4"}}