Fix domain whitelisting and remove unused code

--HG--
extra : rebase_source : a81c93b92a318c70946f35f1cc9fc7fc96a69463