From 2724715e9421aa9f469c2a218b7db24b49fc14d0 Mon Sep 17 00:00:00 2001 From: Alex Reisner <alex@alexreisner.com> Date: Fri, 21 Dec 2012 09:39:08 -0500 Subject: [PATCH] Properly generate query URL. --- lib/geocoder/lookups/maxmind.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/geocoder/lookups/maxmind.rb b/lib/geocoder/lookups/maxmind.rb index 79eecf9b..50fff180 100644 --- a/lib/geocoder/lookups/maxmind.rb +++ b/lib/geocoder/lookups/maxmind.rb @@ -31,8 +31,15 @@ module Geocoder::Lookup ",,,,0,0,0,0,," end - def query_url(query, reverse = false) - "http://geoip3.maxmind.com/f?l=#{Geocoder::Configuration.ip_lookup_api_key}&i=#{query}" + def query_url_params(query) + super.merge( + :l => configuration.api_key, + :i => query.sanitized_text + ) + end + + def query_url(query) + "#{protocol}://geoip3.maxmind.com/f?" + url_query_string(query) end end end -- GitLab