Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions actionpack-cloudfront.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Gem::Specification.new do |spec|
spec.require_paths = ['lib']
spec.add_runtime_dependency 'actionpack', '>= 4.2'
spec.add_runtime_dependency 'railties', '>= 4.2'
spec.add_runtime_dependency 'json', '>= 2.4.0'
spec.add_development_dependency 'appraisal'
spec.add_development_dependency 'bundler'
spec.add_development_dependency 'rake'
Expand Down
4 changes: 2 additions & 2 deletions lib/action_pack/cloudfront/ip_ranges.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ def ip_data
Timeout.timeout(5) do
uri = URI('https://ip-ranges.amazonaws.com/ip-ranges.json')
res = Net::HTTP.get(uri)
JSON.parse(res)
JSON.parse(res, freeze: true)
end
rescue
backup_json = File.join File.dirname(__FILE__), 'ip-ranges.json'
JSON.parse File.read(backup_json)
JSON.load_file(backup_json, freeze: true)
end

extend self
Expand Down