Skip to content
Snippets Groups Projects
Commit a1db1b8d authored by Alex Reisner's avatar Alex Reisner
Browse files

Rename configuration option.

Change :request_headers to :http_headers (for consistency).
parent 0b277a31
No related branches found
No related tags found
No related merge requests found
......@@ -48,7 +48,7 @@ module Geocoder
:timeout,
:lookup,
:language,
:request_headers,
:http_headers,
:use_https,
:http_proxy,
:https_proxy,
......@@ -71,7 +71,7 @@ module Geocoder
@timeout = 3 # geocoding service timeout (secs)
@lookup = :google # name of geocoding service (symbol)
@language = :en # ISO-639 language code
@request_headers = {} # HTTP headers for lookup
@http_headers = {} # HTTP headers for lookup
@use_https = false # use HTTPS for lookup requests? (if supported)
@http_proxy = nil # HTTP proxy server (user:pass@host:port)
@https_proxy = nil # HTTPS proxy server (user:pass@host:port)
......
......@@ -149,7 +149,7 @@ module Geocoder
unless cache and body = cache[url]
client = http_client.new(uri.host, uri.port)
client.use_ssl = true if Geocoder::Configuration.use_https
response = client.get(uri.request_uri, Geocoder::Configuration.request_headers)
response = client.get(uri.request_uri, Geocoder::Configuration.http_headers)
body = response.body
if cache and (200..399).include?(response.code.to_i)
cache[url] = body
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment