{"action":"created","issue":{"url":"https://api.github.com/repos/EFForg/privacybadger/issues/1519","repository_url":"https://api.github.com/repos/EFForg/privacybadger","labels_url":"https://api.github.com/repos/EFForg/privacybadger/issues/1519/labels{/name}","comments_url":"https://api.github.com/repos/EFForg/privacybadger/issues/1519/comments","events_url":"https://api.github.com/repos/EFForg/privacybadger/issues/1519/events","html_url":"https://github.com/EFForg/privacybadger/issues/1519","id":244207935,"node_id":"MDU6SXNzdWUyNDQyMDc5MzU=","number":1519,"title":"Whitelisted wildcard (start with *.) domains disable Badger on all sites with the same base domains","user":{"login":"cowlicks","id":598099,"node_id":"MDQ6VXNlcjU5ODA5OQ==","avatar_url":"https://avatars0.githubusercontent.com/u/598099?v=4","gravatar_id":"","url":"https://api.github.com/users/cowlicks","html_url":"https://github.com/cowlicks","followers_url":"https://api.github.com/users/cowlicks/followers","following_url":"https://api.github.com/users/cowlicks/following{/other_user}","gists_url":"https://api.github.com/users/cowlicks/gists{/gist_id}","starred_url":"https://api.github.com/users/cowlicks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cowlicks/subscriptions","organizations_url":"https://api.github.com/users/cowlicks/orgs","repos_url":"https://api.github.com/users/cowlicks/repos","events_url":"https://api.github.com/users/cowlicks/events{/privacy}","received_events_url":"https://api.github.com/users/cowlicks/received_events","type":"User","site_admin":false},"labels":[{"id":47277669,"node_id":"MDU6TGFiZWw0NzI3NzY2OQ==","url":"https://api.github.com/repos/EFForg/privacybadger/labels/bug","name":"bug","color":"fc2929","default":true},{"id":721453046,"node_id":"MDU6TGFiZWw3MjE0NTMwNDY=","url":"https://api.github.com/repos/EFForg/privacybadger/labels/good%20first%20issue","name":"good first issue","color":"7057ff","default":true},{"id":121133623,"node_id":"MDU6TGFiZWwxMjExMzM2MjM=","url":"https://api.github.com/repos/EFForg/privacybadger/labels/help%20wanted","name":"help wanted","color":"33aa3f","default":true},{"id":98184651,"node_id":"MDU6TGFiZWw5ODE4NDY1MQ==","url":"https://api.github.com/repos/EFForg/privacybadger/labels/low%20priority","name":"low priority","color":"eeeeee","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-07-19T23:56:30Z","updated_at":"2018-06-19T00:12:28Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"For example entering `*.fakesubdomain.mozzilla.org` will disable `mozilla.org`."},"comment":{"url":"https://api.github.com/repos/EFForg/privacybadger/issues/comments/398234080","html_url":"https://github.com/EFForg/privacybadger/issues/1519#issuecomment-398234080","issue_url":"https://api.github.com/repos/EFForg/privacybadger/issues/1519","id":398234080,"node_id":"MDEyOklzc3VlQ29tbWVudDM5ODIzNDA4MA==","user":{"login":"tashachin","id":27714199,"node_id":"MDQ6VXNlcjI3NzE0MTk5","avatar_url":"https://avatars1.githubusercontent.com/u/27714199?v=4","gravatar_id":"","url":"https://api.github.com/users/tashachin","html_url":"https://github.com/tashachin","followers_url":"https://api.github.com/users/tashachin/followers","following_url":"https://api.github.com/users/tashachin/following{/other_user}","gists_url":"https://api.github.com/users/tashachin/gists{/gist_id}","starred_url":"https://api.github.com/users/tashachin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tashachin/subscriptions","organizations_url":"https://api.github.com/users/tashachin/orgs","repos_url":"https://api.github.com/users/tashachin/repos","events_url":"https://api.github.com/users/tashachin/events{/privacy}","received_events_url":"https://api.github.com/users/tashachin/received_events","type":"User","site_admin":false},"created_at":"2018-06-19T00:12:28Z","updated_at":"2018-06-19T00:12:28Z","author_association":"NONE","body":"I want to make sure I understand the codebase and problem correctly:\r\n\r\nUser disables PB on *.fakesubdomain.mozilla.org\r\nUser wants PB enabled on mozilla.org but the wildcard filter catches it\r\n\r\nBased on my investigation, the current fix/logic in #624 produces a false positive with this snippet:\r\n```\r\nif(getBaseDomain(site) === getBaseDomain(origin)){\r\n            return false;\r\n}\r\n\r\ngetBaseDomain(*.fakesubdomain.mozilla.org) // mozilla.org\r\ngetBaseDomain(mozilla.org) // mozilla.org\r\n```\r\nThis issue is a bit beyond me as a newbie, but my first instinct is to check the wildcard's first domain (split on \".\") and compare it to the origin's first domain. (i.e. Does \"mozilla\" match \"fakesubdomain\"? No, therefore PB is enabled on \"mozilla.org\")\r\n\r\nAdditional guidance is much appreciated."}}
{"actor":{"display_login":"tashachin"}}