Skip to content

Commit

Permalink
Merge pull request #192 from pabs3/uri-open-compat
Browse files Browse the repository at this point in the history
Make URI#open cross Ruby versions compatible
  • Loading branch information
hartator committed Sep 4, 2021
2 parents 66ff4d9 + 9da87bf commit fe9893e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/wayback_machine_downloader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def download_file file_remote_info
structure_dir_path dir_path
open(file_path, "wb") do |file|
begin
URI.open("https://web.archive.org/web/#{file_timestamp}id_/#{file_url}", "Accept-Encoding" => "plain") do |uri|
URI("https://web.archive.org/web/#{file_timestamp}id_/#{file_url}").open("Accept-Encoding" => "plain") do |uri|
file.write(uri.read)
end
rescue OpenURI::HTTPError => e
Expand Down

0 comments on commit fe9893e

Please sign in to comment.