Prevent infinite loops for origin hosts in $domains array