{"action":"created","issue":{"url":"https://api.github.com/repos/mozilla/blok/issues/191","repository_url":"https://api.github.com/repos/mozilla/blok","labels_url":"https://api.github.com/repos/mozilla/blok/issues/191/labels{/name}","comments_url":"https://api.github.com/repos/mozilla/blok/issues/191/comments","events_url":"https://api.github.com/repos/mozilla/blok/issues/191/events","html_url":"https://github.com/mozilla/blok/pull/191","id":182300957,"number":191,"title":"fix #150: remove ALL matching allowedHosts items","user":{"login":"groovecoder","id":71928,"avatar_url":"https://avatars.githubusercontent.com/u/71928?v=3","gravatar_id":"","url":"https://api.github.com/users/groovecoder","html_url":"https://github.com/groovecoder","followers_url":"https://api.github.com/users/groovecoder/followers","following_url":"https://api.github.com/users/groovecoder/following{/other_user}","gists_url":"https://api.github.com/users/groovecoder/gists{/gist_id}","starred_url":"https://api.github.com/users/groovecoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/groovecoder/subscriptions","organizations_url":"https://api.github.com/users/groovecoder/orgs","repos_url":"https://api.github.com/users/groovecoder/repos","events_url":"https://api.github.com/users/groovecoder/events{/privacy}","received_events_url":"https://api.github.com/users/groovecoder/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"pdehaan","id":557895,"avatar_url":"https://avatars.githubusercontent.com/u/557895?v=3","gravatar_id":"","url":"https://api.github.com/users/pdehaan","html_url":"https://github.com/pdehaan","followers_url":"https://api.github.com/users/pdehaan/followers","following_url":"https://api.github.com/users/pdehaan/following{/other_user}","gists_url":"https://api.github.com/users/pdehaan/gists{/gist_id}","starred_url":"https://api.github.com/users/pdehaan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdehaan/subscriptions","organizations_url":"https://api.github.com/users/pdehaan/orgs","repos_url":"https://api.github.com/users/pdehaan/repos","events_url":"https://api.github.com/users/pdehaan/events{/privacy}","received_events_url":"https://api.github.com/users/pdehaan/received_events","type":"User","site_admin":false},"assignees":[{"login":"pdehaan","id":557895,"avatar_url":"https://avatars.githubusercontent.com/u/557895?v=3","gravatar_id":"","url":"https://api.github.com/users/pdehaan","html_url":"https://github.com/pdehaan","followers_url":"https://api.github.com/users/pdehaan/followers","following_url":"https://api.github.com/users/pdehaan/following{/other_user}","gists_url":"https://api.github.com/users/pdehaan/gists{/gist_id}","starred_url":"https://api.github.com/users/pdehaan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdehaan/subscriptions","organizations_url":"https://api.github.com/users/pdehaan/orgs","repos_url":"https://api.github.com/users/pdehaan/repos","events_url":"https://api.github.com/users/pdehaan/events{/privacy}","received_events_url":"https://api.github.com/users/pdehaan/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2016-10-11T15:45:41Z","updated_at":"2016-10-11T17:16:51Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mozilla/blok/pulls/191","html_url":"https://github.com/mozilla/blok/pull/191","diff_url":"https://github.com/mozilla/blok/pull/191.diff","patch_url":"https://github.com/mozilla/blok/pull/191.patch"},"body":"I couldn't actually reproduce the original state of #150. I.e., I think it was caused by a previous bug in the add-on that added multiple items of the same host into the `allowedHosts` array. That bug has since been closed, but those of us (like @pdehaan) who had the add-on running before it was closed likely got into a state where we had multiple items of the same host in our `allowedHosts` array.\r\n\r\nTo fix, I wrapped the `allowedHosts.splice` call in a `do...while` loop to clear out **ALL** matching items from the `allowedHosts` array.\r\n\r\nTo test:\r\n\r\n1. Run the add-on and disable protection for a few different sites.\r\n2. Go back to at least one of the sites where you disabled protection, and re-enable it.\r\n\r\nVerify:\r\n\r\nRefresh each of the sites and verify that their protection state is what you expect. I.e., the disabled sites are still disabled, and the re-enabled site(s) is enabled."},"comment":{"url":"https://api.github.com/repos/mozilla/blok/issues/comments/252982936","html_url":"https://github.com/mozilla/blok/pull/191#issuecomment-252982936","issue_url":"https://api.github.com/repos/mozilla/blok/issues/191","id":252982936,"user":{"login":"pdehaan","id":557895,"avatar_url":"https://avatars.githubusercontent.com/u/557895?v=3","gravatar_id":"","url":"https://api.github.com/users/pdehaan","html_url":"https://github.com/pdehaan","followers_url":"https://api.github.com/users/pdehaan/followers","following_url":"https://api.github.com/users/pdehaan/following{/other_user}","gists_url":"https://api.github.com/users/pdehaan/gists{/gist_id}","starred_url":"https://api.github.com/users/pdehaan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdehaan/subscriptions","organizations_url":"https://api.github.com/users/pdehaan/orgs","repos_url":"https://api.github.com/users/pdehaan/repos","events_url":"https://api.github.com/users/pdehaan/events{/privacy}","received_events_url":"https://api.github.com/users/pdehaan/received_events","type":"User","site_admin":false},"created_at":"2016-10-11T17:16:51Z","updated_at":"2016-10-11T17:16:51Z","body":":+1:\r\nLGTM. I don't think I've encountered the error again, since reporting this. So it's hard to verify locally."}}
{"actor":{"display_login":"pdehaan"}}