fixes #6589 - add trusted_hosts check back

There's a test-specific version of smart-proxy (https://github.com/theforeman/smart-proxy/blob/develop/lib/smart_proxy_for_testing.rb), you could register the extension there?