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

Handle non-JSON 404 response from FreeGeoIP.

parent d5a2bd68
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,10 @@ module Geocoder::Lookup
private # ---------------------------------------------------------------
def parse_raw_data(raw_data)
raw_data.match(/^<html><title>404/) ? nil : super(raw_data)
end
def results(query, reverse = false)
# don't look up a loopback address, just return the stored result
return [reserved_result(query)] if loopback_address?(query)
......
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