Skip to content
Snippets Groups Projects
Unverified Commit 491a3014 authored by Robert Schaefer's avatar Robert Schaefer
Browse files

Avoid ipdata lookup headers at root level

suggested by @alexreisner
parent b05df568
No related branches found
No related tags found
No related merge requests found
......@@ -19,7 +19,7 @@ module Geocoder::Lookup
private # ---------------------------------------------------------------
def results(query)
Geocoder.configure(:http_headers => { "api-key" => configuration.api_key }) if configuration.api_key
Geocoder.configure(:ipdata_co => {:http_headers => { "api-key" => configuration.api_key }}) if configuration.api_key
# don't look up a loopback address, just return the stored result
return [reserved_result(query.text)] if query.loopback_ip_address?
# note: Ipdata.co returns plain text on bad request
......
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