[openstreetmap/openstreetmap-website] Set a custom user agent when making http requests (PR #4957)
Anton Khorev
notifications at github.com
Tue Jul 9 11:13:31 UTC 2024
@AntonKhorev requested changes on this pull request.
> @@ -11,14 +11,16 @@ def self.describe_location(lat, lon, zoom = nil, language = nil)
url = "#{Settings.nominatim_url}reverse?lat=#{lat}&lon=#{lon}&zoom=#{zoom}&accept-language=#{language}"
begin
- response = Timeout.timeout(4) do
- REXML::Document.new(Net::HTTP.get(URI.parse(url)))
+ response = OSM.http_client.get(URI.parse(url)) do |request|
+ request.timeout = 4
> undefined method `timeout=' for #<struct Faraday::Request ...
```suggestion
request.options.timeout = 4
```
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4957#pullrequestreview-2166004150
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/4957/review/2166004150 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240709/894bc8f1/attachment.htm>
More information about the rails-dev
mailing list