Use Faraday in place of Net::HTTP so we can mock responses
[rails.git] / app / controllers / geocoder_controller.rb
index be4f0570c828c298dedda67fd3446a0aed5686bd..5a59c9eeb159761486c93b14e5913530ac61acbf 100644 (file)
@@ -3,7 +3,6 @@
 class GeocoderController < ApplicationController
   require "cgi"
   require "uri"
-  require "net/http"
   require "rexml/document"
 
   before_action :authorize_web
@@ -287,7 +286,7 @@ class GeocoderController < ApplicationController
   private
 
   def fetch_text(url)
-    Net::HTTP.get(URI.parse(url))
+    OSM.http_client.get(URI.parse(url)).body
   end
 
   def fetch_xml(url)