forked from sozialhelden/wheelmap-classic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request sozialhelden#673 from sozialhelden/fix-use-https-f…
…or-nominatim search fix: use https for nominatim
- Loading branch information
Showing
2 changed files
with
4 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
class SearchController < ApplicationController | ||
URL = 'http://nominatim.openstreetmap.org/search'.freeze | ||
URL = 'https://nominatim.openstreetmap.org/search'.freeze | ||
# URL = "http://open.mapquestapi.com/nominatim/v1/search" | ||
DEFAULT_PARAMS = { limit: 10, email: '[email protected]', dedupe: '1' }.freeze | ||
USERAGENT = 'Wheelmap v1.0, (http://wheelmap.org)'.freeze | ||
|
@@ -15,6 +15,8 @@ class SearchController < ApplicationController | |
def index | ||
@search_url = URI.parse(URL) | ||
@http = Net::HTTP.new(@search_url.host, @search_url.port) | ||
@http.use_ssl = true | ||
@http.verify_mode = OpenSSL::SSL::VERIFY_PEER | ||
@http.read_timeout = 2 | ||
@http.open_timeout = 2 | ||
@query = DEFAULT_PARAMS.reverse_merge('accept-language': I18n.locale, q: params[:q]) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters