Fix redirects in discover provider

* Extract Net::HTTP Code in class method and reuse in `discover_provider` to make use of existing redirect handling
* Add specs for 404 and 301 HTTP return codes in `discover_provider`
* Accept timeout option in `discover_provider`