Use https for nominatim
authorTom Hughes <tom@compton.nu>
Mon, 8 Jan 2018 10:49:36 +0000 (10:49 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 8 Jan 2018 10:50:44 +0000 (10:50 +0000)
app/assets/javascripts/index/directions.js
app/controllers/geocoder_controller.rb
config/example.application.yml

index bb835f2fb277f21d6db8ea946590f760782deeac..94f9bb1f018f05ca6894cede85f4cdab7b76bfee 100644 (file)
@@ -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) {
index 5d7ba918938541468504bd08342f1a5d6f21b36b..0a00622466f7395ba694c61c5541605ca405e4fb 100644 (file)
@@ -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|
index 26431f4742fef38d6e63d674432809d322378fd2..22e5c4c9e5ac5d5db182b190f738a1bed2d98339 100644 (file)
@@ -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