From 50ea797f33409aecb6061f3f6baceb5c499edb2a Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 25 Mar 2014 18:43:58 +0000 Subject: [PATCH] Add https support for overpass --- app/assets/javascripts/index/query.js | 8 +++++--- config/example.application.yml | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/index/query.js b/app/assets/javascripts/index/query.js index 01a8a1f69..58750d242 100644 --- a/app/assets/javascripts/index/query.js +++ b/app/assets/javascripts/index/query.js @@ -1,7 +1,9 @@ //= require jquery.simulate OSM.Query = function(map) { - var queryButton = $(".control-query .control-button"), + var protocol = document.location.protocol === "https:" ? "https:" : "http:", + url = protocol + OSM.OVERPASS_URL, + queryButton = $(".control-query .control-button"), uninterestingTags = ['source', 'source_ref', 'source:ref', 'history', 'attribution', 'created_by', 'tiger:county', 'tiger:tlid', 'tiger:upload_uuid'], marker; @@ -163,7 +165,7 @@ OSM.Query = function(map) { } $section.data("ajax", $.ajax({ - url: OSM.OVERPASS_URL, + url: url, method: "POST", data: { data: "[timeout:5][out:json];" + query, @@ -203,7 +205,7 @@ OSM.Query = function(map) { $section.find(".loader").stopTime("loading").hide(); $("
  • ") - .text(I18n.t("javascripts.query." + status, { server: OSM.OVERPASS_URL, error: error })) + .text(I18n.t("javascripts.query." + status, { server: url, error: error })) .appendTo($ul); } })); diff --git a/config/example.application.yml b/config/example.application.yml index 702d411ba..7f6aaf298 100644 --- a/config/example.application.yml +++ b/config/example.application.yml @@ -85,7 +85,7 @@ defaults: &defaults # Whether to require users to agree to the CTs before editing require_terms_agreed: false # URL of Overpass instance to use for feature queries - overpass_url: http://overpass-api.de/api/interpreter + overpass_url: "//overpass-api.de/api/interpreter" development: <<: *defaults -- 2.43.2