fixes #6589 - add trusted_hosts check back

Hmm, there's that. We could replace smart_proxy_for_testing with something like smart_proxy_common and use that in both production and tests (Proxy::SETTINGS can be defined in test_helper).