{"action":"created","issue":{"url":"https://api.github.com/repos/thoughtbot/yesod-auth-oauth2/issues/45","labels_url":"https://api.github.com/repos/thoughtbot/yesod-auth-oauth2/issues/45/labels{/name}","comments_url":"https://api.github.com/repos/thoughtbot/yesod-auth-oauth2/issues/45/comments","events_url":"https://api.github.com/repos/thoughtbot/yesod-auth-oauth2/issues/45/events","html_url":"https://github.com/thoughtbot/yesod-auth-oauth2/pull/45","id":119306195,"number":45,"title":"Append the state query parameter correctly","user":{"login":"pbrisbin","id":50812,"avatar_url":"https://avatars.githubusercontent.com/u/50812?v=3","gravatar_id":"","url":"https://api.github.com/users/pbrisbin","html_url":"https://github.com/pbrisbin","followers_url":"https://api.github.com/users/pbrisbin/followers","following_url":"https://api.github.com/users/pbrisbin/following{/other_user}","gists_url":"https://api.github.com/users/pbrisbin/gists{/gist_id}","starred_url":"https://api.github.com/users/pbrisbin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pbrisbin/subscriptions","organizations_url":"https://api.github.com/users/pbrisbin/orgs","repos_url":"https://api.github.com/users/pbrisbin/repos","events_url":"https://api.github.com/users/pbrisbin/events{/privacy}","received_events_url":"https://api.github.com/users/pbrisbin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-28T16:50:39Z","updated_at":"2015-11-30T16:47:35Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/thoughtbot/yesod-auth-oauth2/pulls/45","html_url":"https://github.com/thoughtbot/yesod-auth-oauth2/pull/45","diff_url":"https://github.com/thoughtbot/yesod-auth-oauth2/pull/45.diff","patch_url":"https://github.com/thoughtbot/yesod-auth-oauth2/pull/45.patch"},"body":"If the endpoint URL doesn't yet have any query parameters, this code would\nconstruct an invalid URL by appending `&state=` rather than `?state=`. We now\ncorrectly append `?state=` or `&state=` depending on the URL already containing\na `?` character.\n\nFixes #44\n\nThis is a \"good enough\" solution for the moment, done for ease of\nimplementation and speed of delivery. An eventual better solution would be to\nuse a URL-parsing and constructing library to parse the existing endpoint,\nappend parameter tuples, and re-construct a new URL.\n\nRestructuring the data types so we start handling real URL and QueryParam\nvalues instead of ByteStrings would also be an option, though we're a little\ncornered by the Yesod.Auth.OAuth interface.\n\n/cc @thoughtbot/haskell @jferris"},"comment":{"url":"https://api.github.com/repos/thoughtbot/yesod-auth-oauth2/issues/comments/160685875","html_url":"https://github.com/thoughtbot/yesod-auth-oauth2/pull/45#issuecomment-160685875","issue_url":"https://api.github.com/repos/thoughtbot/yesod-auth-oauth2/issues/45","id":160685875,"user":{"login":"jferris","id":7591,"avatar_url":"https://avatars.githubusercontent.com/u/7591?v=3","gravatar_id":"","url":"https://api.github.com/users/jferris","html_url":"https://github.com/jferris","followers_url":"https://api.github.com/users/jferris/followers","following_url":"https://api.github.com/users/jferris/following{/other_user}","gists_url":"https://api.github.com/users/jferris/gists{/gist_id}","starred_url":"https://api.github.com/users/jferris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jferris/subscriptions","organizations_url":"https://api.github.com/users/jferris/orgs","repos_url":"https://api.github.com/users/jferris/repos","events_url":"https://api.github.com/users/jferris/events{/privacy}","received_events_url":"https://api.github.com/users/jferris/received_events","type":"User","site_admin":false},"created_at":"2015-11-30T16:47:35Z","updated_at":"2015-11-30T16:47:35Z","body":"Okay. Sounds like \"get a test harness in place\" is another good TODO."}}