remove buggy reimplementation of get_host

also add allowed hosts