{"action":"created","issue":{"url":"https://api.github.com/repos/strophe/strophejs/issues/306","repository_url":"https://api.github.com/repos/strophe/strophejs","labels_url":"https://api.github.com/repos/strophe/strophejs/issues/306/labels{/name}","comments_url":"https://api.github.com/repos/strophe/strophejs/issues/306/comments","events_url":"https://api.github.com/repos/strophe/strophejs/issues/306/events","html_url":"https://github.com/strophe/strophejs/pull/306","id":352350267,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA5NjgzNzQ0","number":306,"title":"Refine _connect_cb_wrapper, convert messages at top","user":{"login":"jhaenchen","id":7771519,"node_id":"MDQ6VXNlcjc3NzE1MTk=","avatar_url":"https://avatars1.githubusercontent.com/u/7771519?v=4","gravatar_id":"","url":"https://api.github.com/users/jhaenchen","html_url":"https://github.com/jhaenchen","followers_url":"https://api.github.com/users/jhaenchen/followers","following_url":"https://api.github.com/users/jhaenchen/following{/other_user}","gists_url":"https://api.github.com/users/jhaenchen/gists{/gist_id}","starred_url":"https://api.github.com/users/jhaenchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhaenchen/subscriptions","organizations_url":"https://api.github.com/users/jhaenchen/orgs","repos_url":"https://api.github.com/users/jhaenchen/repos","events_url":"https://api.github.com/users/jhaenchen/events{/privacy}","received_events_url":"https://api.github.com/users/jhaenchen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-21T01:16:57Z","updated_at":"2018-08-21T02:07:19Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/strophe/strophejs/pulls/306","html_url":"https://github.com/strophe/strophejs/pull/306","diff_url":"https://github.com/strophe/strophejs/pull/306.diff","patch_url":"https://github.com/strophe/strophejs/pull/306.patch"},"body":"Hi!\r\n\r\nThis PR does a couple things:\r\n\r\n- Fixes an issue where `getAttribute is not a function` would be thrown whenever the `<close>` tag is received, since we were checking for the attribute `see-other-uri` before converting to an XML element using the `DomParser`. Originally I converted to XML inside the if block for `<close>`. But...\r\n- Changes the behavior such that XML conversion happens at the beginning of the handler since all three blocks do the parsing anyway. Additionally, we report the raw data and parsed XML element at the beginning as well.\r\n- Converts all `var` in this handler to `const`. I noticed that `var` is being used quite a lot, but particularly in a large `if-else` block like this one, declaring `var`s can be very tricky as the variables escape their block scope to the function scope. If requested I can revert back to vars."},"comment":{"url":"https://api.github.com/repos/strophe/strophejs/issues/comments/414525932","html_url":"https://github.com/strophe/strophejs/pull/306#issuecomment-414525932","issue_url":"https://api.github.com/repos/strophe/strophejs/issues/306","id":414525932,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNDUyNTkzMg==","user":{"login":"jhaenchen","id":7771519,"node_id":"MDQ6VXNlcjc3NzE1MTk=","avatar_url":"https://avatars1.githubusercontent.com/u/7771519?v=4","gravatar_id":"","url":"https://api.github.com/users/jhaenchen","html_url":"https://github.com/jhaenchen","followers_url":"https://api.github.com/users/jhaenchen/followers","following_url":"https://api.github.com/users/jhaenchen/following{/other_user}","gists_url":"https://api.github.com/users/jhaenchen/gists{/gist_id}","starred_url":"https://api.github.com/users/jhaenchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhaenchen/subscriptions","organizations_url":"https://api.github.com/users/jhaenchen/orgs","repos_url":"https://api.github.com/users/jhaenchen/repos","events_url":"https://api.github.com/users/jhaenchen/events{/privacy}","received_events_url":"https://api.github.com/users/jhaenchen/received_events","type":"User","site_admin":false},"created_at":"2018-08-21T02:07:19Z","updated_at":"2018-08-21T02:07:19Z","author_association":"NONE","body":"Also, while I was there I noticed we just redirect to whatever URI is sent for `see-other-uri`. If someone can confirm that my thinking is correct on that, I'm happy to submit an additional PR for checking if the URL is wss or https and denying otherwise, per the spec."}}
{"actor":{"display_login":"jhaenchen"}}