]> git.openstreetmap.org Git - rails.git/commitdiff
Set a custom user agent for the faraday http client
authorTom Hughes <tom@compton.nu>
Fri, 5 Jul 2024 18:29:06 +0000 (19:29 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 9 Jul 2024 17:18:09 +0000 (18:18 +0100)
lib/osm.rb

index dd273418e52cc562c95f94b67ef1bba47218f1c3..46f37036f92d796243960cf1c7c8b63fdd91244e 100644 (file)
@@ -535,7 +535,8 @@ module OSM
 
   # Return the HTTP client to use
   def self.http_client
-    @http_client ||= Faraday.new(:request => { :timeout => 15 })
+    @http_client ||= Faraday.new(:request => { :timeout => 15 },
+                                 :headers => { :user_agent => Settings.server_url })
   end
 
   # Return the MaxMindDB database handle