Fixes #8514 - Add support for requests to smart proxy discovery plugin

i would simply write it as:
```ruby
proxy_url = if subnet.try(:discovery_id)
  SmartProxy.find(self.subnet.discovery_id).url + "/discovery/#{self.ip}"
else
  "http://#{self.ip}:8443"
end
```