From: Tom Hughes Date: Mon, 8 Jan 2018 10:49:36 +0000 (+0000) Subject: Use https for nominatim X-Git-Tag: live~3170 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/af1397436f0a1fd1c8170e3935a13c3ec51ea948 Use https for nominatim --- diff --git a/app/assets/javascripts/index/directions.js b/app/assets/javascripts/index/directions.js index bb835f2fb..94f9bb1f0 100644 --- a/app/assets/javascripts/index/directions.js +++ b/app/assets/javascripts/index/directions.js @@ -76,7 +76,7 @@ OSM.Directions = function (map) { endpoint.awaitingGeocode = true; - $.getJSON(document.location.protocol + OSM.NOMINATIM_URL + 'search?q=' + encodeURIComponent(endpoint.value) + '&format=json', function (json) { + $.getJSON(OSM.NOMINATIM_URL + 'search?q=' + encodeURIComponent(endpoint.value) + '&format=json', function (json) { endpoint.awaitingGeocode = false; endpoint.hasGeocode = true; if (json.length === 0) { diff --git a/app/controllers/geocoder_controller.rb b/app/controllers/geocoder_controller.rb index 5d7ba9189..0a0062246 100644 --- a/app/controllers/geocoder_controller.rb +++ b/app/controllers/geocoder_controller.rb @@ -120,7 +120,7 @@ class GeocoderController < ApplicationController exclude = "&exclude_place_ids=#{params[:exclude]}" if params[:exclude] # ask nominatim - response = fetch_xml("http:#{NOMINATIM_URL}search?format=xml&extratags=1&q=#{escape_query(query)}#{viewbox}#{exclude}&accept-language=#{http_accept_language.user_preferred_languages.join(',')}") + response = fetch_xml("#{NOMINATIM_URL}search?format=xml&extratags=1&q=#{escape_query(query)}#{viewbox}#{exclude}&accept-language=#{http_accept_language.user_preferred_languages.join(',')}") # extract the results from the response results = response.elements["searchresults"] @@ -217,7 +217,7 @@ class GeocoderController < ApplicationController @results = [] # ask nominatim - response = fetch_xml("http:#{NOMINATIM_URL}reverse?lat=#{lat}&lon=#{lon}&zoom=#{zoom}&accept-language=#{http_accept_language.user_preferred_languages.join(',')}") + response = fetch_xml("#{NOMINATIM_URL}reverse?lat=#{lat}&lon=#{lon}&zoom=#{zoom}&accept-language=#{http_accept_language.user_preferred_languages.join(',')}") # parse the response response.elements.each("reversegeocode/result") do |result| diff --git a/config/example.application.yml b/config/example.application.yml index 26431f474..22e5c4c9e 100644 --- a/config/example.application.yml +++ b/config/example.application.yml @@ -74,7 +74,7 @@ defaults: &defaults # Enable legacy OAuth 1.0 support oauth_10_support: true # URL of Nominatim instance to use for geocoding - nominatim_url: "//nominatim.openstreetmap.org/" + nominatim_url: "https://nominatim.openstreetmap.org/" # Default editor default_editor: "id" # OAuth consumer key for Potlatch 2