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

Merge branch 'master' of git://github.com/Vayable/geocoder into pr/385

Conflicts:
	lib/geocoder/lookups/base.rb
parents a76cdcef 332dcbe9
No related branches found
No related tags found
No related merge requests found
......@@ -216,6 +216,19 @@ module Geocoder
response = make_api_request(query)
check_response_for_errors!(response)
body = response.body
# apply the charset from the Content-Type header, if possible
ct = response['content-type']
if ct && ct['charset']
charset = ct.split(';').select do |s|
s['charset']
end.first.to_s.split('=')
if charset.length == 2
body.force_encoding(charset.last) rescue ArgumentError
end
end
if cache and valid_response?(response)
cache[key] = body
end
......
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